Tokenize base-class name spans
The observer's base-class references are compiler-proven name spans, so they join the type tokens alongside each class's own name. A real stdio session decoded Base at its declaration line as a type token.
This commit is contained in:
1 parent
4a029152e9
commit
1f01bcbfd5
3 files changed
+21
-1
No files matched your search
@@ -1424,6 +1424,15 @@ Json EditorDiagnostics::semantic_tokens(std::string_view uri) const {
|
||||
tokens.push_back({type.self.range.start.line, type.self.range.start.character,
|
||||
type.self.range.end.character - type.self.range.start.character,
|
||||
features::semantic_tokens::type_type, 0});
|
||||
for (const auto &base : type.bases) {
|
||||
if (base.path != snapshot->identity.canonical_path.native() ||
|
||||
base.range.start.line != base.range.end.line ||
|
||||
base.range.end.character <= base.range.start.character)
|
||||
continue;
|
||||
tokens.push_back({base.range.start.line, base.range.start.character,
|
||||
base.range.end.character - base.range.start.character,
|
||||
features::semantic_tokens::type_type, 0});
|
||||
}
|
||||
}
|
||||
const auto normalized = features::semantic_tokens::normalize(tokens);
|
||||
Json::Array data;
|
||||
|
||||
Reference in new issue
Block a user