[PATCH] D148489: [clangd] Implement configs to stop clangd produce a certain semantic tokens

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 7 23:59:11 PDT 2023


nridge requested changes to this revision.
nridge added a comment.
This revision now requires changes to proceed.

Thanks for the patch!

I think this is a nice and general solution, which rather than solving just a specific problem (e.g. highlighting of `new` as an operator vs. a keyword), gives users a broader ability to fine-tune clangd's highlightings to suit their needs.

Could I kindly ask you to make a PR that updates https://github.com/llvm/clangd-www/blob/main/config.md to cover the new config keys, as well?



================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:400
+  bool ActiveKindLookup[static_cast<size_t>(HighlightingKind::LastKind) + 1];
+  uint32_t ActiveModifiersMask;
+};
----------------
For good measure, let's `static_assert(HighlightingModifier::LastModifier < 32)`


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:590
   const LangOptions &LangOpts;
+  const HighlightingFilter &Filter;
   bool IncludeInactiveRegionTokens;
----------------
This needs to be stored by value, otherwise it will dangle


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148489



More information about the cfe-commits mailing list