[PATCH] D69506: [clangd] Add missing highlights for using decls.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 06:52:43 PDT 2019


ilya-biryukov added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:51
   }
+  if (auto *UD = dyn_cast<UsingDecl>(D)) {
+    if (UD->shadow_size() == 0)
----------------
Could we reuse `kindForCandidateDecls` instead?
It's best to keep one way to highlight multiple decls.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:60
+    });
+    return kindForDecl(Selected->getTargetDecl());
+  }
----------------
Using decls never have any references and we only highlight them at their declarations locations.
Therefore `kindForDecl` seems like the wrong place for it. Could we add a `VisitUsingDecl` method to the visitor and have this logic there instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69506





More information about the cfe-commits mailing list