[PATCH] D69673: [clangd] Implement semantic highlightings via findExplicitReferences
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 4 02:40:51 PST 2019
hokein added inline comments.
================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:194
+ const SourceManager &SM;
+ const LangOptions &LO;
+ std::vector<HighlightingToken> Tokens;
----------------
nit: I'd call it `LangOpts`
================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:200
+/// e.g. highlights dependent names and 'auto' as the underlying type.
+class CollectHighlightings : public RecursiveASTVisitor<CollectHighlightings> {
+public:
----------------
maybe call it `CollectExtraHiglightings` or `CollectAdditionalHighlightings`?
================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:220
+ bool VisitOverloadExpr(OverloadExpr *E) {
+ if (!E->decls().empty())
+ return true; // handled by findExplicitReferences.
----------------
IIUC, if the decls don't have the same kind, we will not highlight it (previously, we fall back to `DependentName`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69673/new/
https://reviews.llvm.org/D69673
More information about the cfe-commits
mailing list