Tokenize observer-reported type names

The semantic token legend gains a type entry, and the server emits it
for each class name span reported by the observer when it lies in the
open document. The canonical type itself is still not tokenized
because it has no source span. Registered tests cover the legend index,
and a real stdio session decoded the class names as type tokens beside
the function and declaration tokens.
This commit is contained in:
faumaray committed 2026-12-05 23:56:39 +03:00
1 parent 86b9923532
commit 4b534c61ae
7 files changed
+37 -3

No files matched your search

+8
View File
@@ -67,3 +67,11 @@ VOID_TEST(SemanticTokens, an_overlapping_token_never_replaces_the_earlier_one) {
require(result.size() == 1);
expect(result.front().modifiers == 0);
}
VOID_TEST(SemanticTokens, type_tokens_keep_their_legend_index) {
const std::vector<Token> tokens{{0, 0, 4, function_type, 0}, {0, 6, 7, type_type, 0}};
const auto result = normalize(tokens);
require(result.size() == 2);
expect(result[1].type == type_type);
expect(encode(result) == std::vector<std::uint32_t>{0, 0, 4, 0, 0, 0, 6, 7, 1, 0});
}