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
@@ -41,7 +41,7 @@ missing part. Updated December 5, 2026 after semantic tokens and inlay hints.
|
|||||||
| callHierarchy / typeHierarchy | prepare, incomingCalls and outgoingCalls are implemented and served; outgoing calls are verified over stdio now that the observer reports full function extents. Type hierarchy is open. |
|
| callHierarchy / typeHierarchy | prepare, incomingCalls and outgoingCalls are implemented and served; outgoing calls are verified over stdio now that the observer reports full function extents. Type hierarchy is open. |
|
||||||
| Client-side application of server-issued workspace edits | rename and code actions return edits the clients apply directly |
|
| Client-side application of server-issued workspace edits | rename and code actions return edits the clients apply directly |
|
||||||
| Applying multi-file renames through client buffers | plans can be ready; application is client work |
|
| Applying multi-file renames through client buffers | plans can be ready; application is client work |
|
||||||
| richer token types | legend has `function` and `type` plus a `declaration` modifier; more types/modifiers need further compiler spans |
|
| richer token types | legend has `function` and `type` (class, base, definition names) plus a `declaration` modifier; more types need further compiler spans |
|
||||||
|
|
||||||
## Next slices
|
## Next slices
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,17 @@ start coordinate only, so ranges are zero-width until an end is available.
|
|||||||
LSP adapters and index/rename/debugging integration remain open. `vbs test`
|
LSP adapters and index/rename/debugging integration remain open. `vbs test`
|
||||||
passed all 17 native suites; CMake passed the reflection and trace suites.
|
passed all 17 native suites; CMake passed the reflection and trace suites.
|
||||||
|
|
||||||
|
## December 6 base-class tokens in semantic tokens
|
||||||
|
|
||||||
|
Semantic tokens now also cover the observer-reported base-class name spans
|
||||||
|
when they lie in the open document, as `type` tokens alongside the class's own
|
||||||
|
name. Real stdio session over `Base`/`DerivedA`/`DerivedB`:
|
||||||
|
```
|
||||||
|
semanticTokens: [(0, 7, 4, 1, 0), (1, 7, 8, 1, 0), (2, 7, 8, 1, 0), (3, 9, 6, 0, 1), ...]
|
||||||
|
```
|
||||||
|
The first entry is `Base` at its declaration. All 18 native suites and all 18
|
||||||
|
CMake tests passed.
|
||||||
|
|
||||||
## December 6 compiler-agnostic completion source
|
## December 6 compiler-agnostic completion source
|
||||||
|
|
||||||
Per D-032, completion can now consume a documented, compiler-agnostic index
|
Per D-032, completion can now consume a documented, compiler-agnostic index
|
||||||
|
|||||||
@@ -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,
|
tokens.push_back({type.self.range.start.line, type.self.range.start.character,
|
||||||
type.self.range.end.character - type.self.range.start.character,
|
type.self.range.end.character - type.self.range.start.character,
|
||||||
features::semantic_tokens::type_type, 0});
|
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);
|
const auto normalized = features::semantic_tokens::normalize(tokens);
|
||||||
Json::Array data;
|
Json::Array data;
|
||||||
|
|||||||
Reference in new issue
Block a user