[clang-tools-extra] Symbol tags in SymbolInformation, WorkspaceSymbol, CallHierarchyItem and TypeHierarchyItem (PR #170103)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 25 05:33:14 PDT 2026
================
@@ -22,6 +23,15 @@ namespace clangd {
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
+/// A bitmask type representing symbol tags supported by LSP.
+/// \see
+/// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#symbolTag
+using SymbolTags = uint32_t;
----------------
timon-ul wrote:
I think we can couple this more deeply to `SymbolTag`, making the below assert also obsolete in the process. For this I see 2 ways to go about this, the first one is we simply operate like `SymbolFlag` (further down in this file), where we directly operate on the enum, making it already represent a combination of enums. Also I like that we have pre defined operators on the enum there. I can understand if you like to have a more clear difference between the enum and the aggregated enum, so the second option would be to simply set `using SymbolTags = SymbolTag` to guarantee the same underlaying type. By the way both of these options want you to then have a enum for `0`, but since you start assigning values with `1` you can easily add a `None` enum with value `0` (again I am referencing `SymbolFlag`) without it costing additional encoding space.
https://github.com/llvm/llvm-project/pull/170103
More information about the cfe-commits
mailing list