[PATCH] D127403: [clangd] Implement semantic token modifier "definition"

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 8 11:58:01 PDT 2022


dgoldman added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:863
+              Tok.addModifier(HighlightingModifier::Declaration);
+            if (const auto Func = dyn_cast<FunctionDecl>(Decl)) {
+              if (Func->isThisDeclarationADefinition())
----------------
Instead of doing it like this, I wonder if would make more sense to call getDefinition from https://cs.github.com/llvm/llvm-project/blob/ae071a59bc6cc09e0e0043e0ef1d9725853f1681/clang-tools-extra/clangd/XRefs.cpp#L76 and if it matches Decl, add the Definition modifier?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127403



More information about the cfe-commits mailing list