[clang-tools-extra] LSP 3.18 - Symbol Tags (PR #167536)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 19 23:23:34 PST 2026
================
@@ -1157,31 +1060,40 @@ getSemanticHighlightings(ParsedAST &AST, bool IncludeInactiveRegionTokens) {
}
if (auto Mod = scopeModifier(Decl))
Tok.addModifier(*Mod);
- if (isConst(Decl))
- Tok.addModifier(HighlightingModifier::Readonly);
- if (isStatic(Decl))
- Tok.addModifier(HighlightingModifier::Static);
- if (isAbstract(Decl))
- Tok.addModifier(HighlightingModifier::Abstract);
- if (isVirtual(Decl))
- Tok.addModifier(HighlightingModifier::Virtual);
+
+ const auto SymbolTags = computeSymbolTags(*Decl);
+
+ static const llvm::DenseMap<SymbolTag, HighlightingModifier>
----------------
HighCommander4 wrote:
This code can be run concurrently from multiple threads, so I don't think we can make it `static`.
But maybe we can make it `static thread_local`? We have [existing uses](https://github.com/llvm/llvm-project/blob/d09fac453640fa1b174a82f707c4e5c063544b4b/clang-tools-extra/clangd/support/Context.cpp#L23) of that in clangd code so it should work.
https://github.com/llvm/llvm-project/pull/167536
More information about the cfe-commits
mailing list