Read comments, annotations and modifiers from semantic tokens - #54
Merged
PiotrRogulski merged 1 commit intoSep 17, 2026
Conversation
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 09:28
d229e31 to
7bb444c
Compare
This was referenced Sep 17, 2026
PiotrRogulski
added this pull request to stack #57
September 17, 2026 09:35
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
4 times, most recently
from
September 17, 2026 10:39
7fd4ea2 to
78f75a9
Compare
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 11:42
78f75a9 to
801e5ff
Compare
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 11:44
801e5ff to
10c6277
Compare
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 11:49
10c6277 to
c98518c
Compare
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
2 times, most recently
from
September 17, 2026 11:53
d436a92 to
6816e93
Compare
PiotrRogulski
commented
Sep 17, 2026
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 12:08
6816e93 to
db6652f
Compare
PiotrRogulski
marked this pull request as ready for review
September 17, 2026 12:13
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 12:35
db6652f to
3a30bb3
Compare
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 12:56
3a30bb3 to
dd93cc5
Compare
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 13:15
dd93cc5 to
9db843d
Compare
Komoszek
approved these changes
Sep 17, 2026
The server's semantic tokens classify every span as a comment, keyword, annotation, string or declaration. Use them for the doc-reference check (which now covers /** */ blocks), the @OverRide, @freezed and vm:entry-point checks, and the final-field check, instead of stripping comments and scanning a hand-rolled token stream. Tokens are fetched for every scanned file, and for referenced files before classification; the cross-library check reuses them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0146xh6qZsHDegsCAoRBEqwz
PiotrRogulski
force-pushed
the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
from
September 17, 2026 19:32
9db843d to
6b59dbc
Compare
PiotrRogulski
deleted the
claude/quirky-hawking-jdfvsx-2-semantic-tokens
branch
September 17, 2026 20:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
semanticTokens/fullclassifies every span:comment(withdocumentation),keyword,string, annotation names with theannotationmodifier, declarations withstatic/instance. A doc comment's[Foo]link is its ownclasstoken, so a doc reference is one whose line opens with a documentation-comment token. The server serves tokens for files that were never opened.lib/src/lsp/semantic_tokens.dart: legend, decoder, position lookups. Tokens are fetched with the symbols and outline for every scanned file, and before classification for referenced files outside the scan.isDocReference: line's first token is a doc comment (wasstartsWith('///'), which missed/** */).@override,vm:entry-point,@freezed: annotation tokens in the declaration's metadata, replacing comment stripping and a regex.classHasFinalInstanceField: keyword tokens before the field statement's first declarator, replacing a backward scan over the lexer's tokens.Behavior: a reference in a
/** */doc block is now doc-only. One more request per scanned file.🤖 Generated with Claude Code
https://claude.ai/code/session_0146xh6qZsHDegsCAoRBEqwz