sammccall added inline comments.

================
Comment at: 
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp:15
+
+llvm::StringRef highlightingKindToString(HighlightingKind Kind) {
+  switch (Kind) {
----------------
it would be nice to use the textmate class name rather than an arbitrary string 
here, it saves a level of indirection when verifying/debugging behavior


================
Comment at: 
clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp:48
+Expected<Tweak::Effect> AnnotateHighlightings::apply(const Selection &Inputs) {
+  auto HighlightingTokens = getSemanticHighlightings(Inputs.AST);
+  auto &SM = Inputs.AST.getSourceManager();
----------------
These operations are contextual, it would be nice to root at the selected node.

You should be able to do (approximately) this by walking up to the next decl 
and using it as the traversal scope - don't forget to reset it afterwards!

(This is a bit hacky and invalidates the parent map, but it's a debug tweak so 
it should be OK)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64137/new/

https://reviews.llvm.org/D64137



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to