Mark same-file definitions in semantic tokens

The server legend gains a declaration modifier, and EditorDiagnostics
emits the definition-name token with it when the definition lies in the
same document. No type token is emitted because the canonical type has
no source span. Registered tests cover modifier encoding and the
overlap rule; a real stdio session showed the modifier on both
definition names.
This commit is contained in:
faumaray committed 2026-12-05 18:27:17 +03:00
1 parent 2cced8363d
commit 816c38da1e
7 files changed
+54 -10

No files matched your search

+2
View File
@@ -11,6 +11,8 @@ namespace vls::features::semantic_tokens {
// Indices into the legend the server advertises. Only tokens the stock
// observer can prove are represented; there are no keyword or guess tokens.
inline constexpr std::uint32_t function_type = 0;
// Bit flag in Token::modifiers, matching the server's advertised legend.
inline constexpr std::uint32_t declaration_modifier = 1;
struct Token {
std::uint32_t line{}, character{}, length{};