[PATCH] D76896: [clangd] Color dependent names based on their heuristic target if they have one

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 15:12:43 PDT 2020


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:211
         NonConflicting.push_back(TokRef.front());
+      else if (auto Resolved = resolveConflict(Conflicting))
+        NonConflicting.push_back(*Resolved);
----------------
nridge wrote:
> sammccall wrote:
> > out of curiosity, *why* is the same token being highlighted as dependentname and resolved? Is it being traversed twice?
> It's for the reason you described in [this comment](https://github.com/clangd/clangd/issues/297#issuecomment-593736036): the resolved highlighting comes from `findExplicitReferences()`, and the dependent one form `CollectExtraHighlightings`.
Oh yeah :-)
Can we add a comment somewhere about this case? e.g. on resolveConflict (this happens when...)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76896





More information about the cfe-commits mailing list