Add semantic tokens support - #136
Open
msujew wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: d971cab | Previous: d803417 | Ratio |
|---|---|---|---|
BenchmarkWorkspaceCycle (typefox.dev/fastbelt/examples/statemachine) - MB/s |
13 MB/s |
5.21 MB/s |
2.50 |
This comment was automatically generated by workflow using github-action-benchmark.
msujew
force-pushed
the
msujew/semantic-tokens
branch
from
August 6, 2026 12:55
97f005c to
d971cab
Compare
Lotes
reviewed
Aug 10, 2026
| d.fixture.t.Fatalf("fbtest: no marker with label %q", label) | ||
| } | ||
|
|
||
| semanticTokensProvider := service.MustGet[server.SemanticTokensProvider](d.fixture.sc) |
Collaborator
There was a problem hiding this comment.
Would a cache make sense? AFAICS this is recomputed for each assertion.
Member
Author
There was a problem hiding this comment.
I thought about that as well, but I can't imagine this ever becoming a performance bottleneck. I would keep it as is for now. An alternative API that I've considered (similar to the diagnostics assertion API):
semanticTokens := doc.ExpectSemanticTokens()
semanticTokens.Assert("function", x, y)
semanticTokens.Assert("variable", u, v)WDYT? We can then cache the value on semanticTokens.
msujew
force-pushed
the
msujew/semantic-tokens
branch
from
August 19, 2026 13:44
d971cab to
0e72789
Compare
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.
Closes #95
Provides the infrastructure to implement semantic tokens support for any language. Comes with:
AssertSemanticTokens.ExtendableSemanticTokensLegendProvider.SemanticTokensBuilder.TokenHighlightingStrategyandTokenBasedSemanticTokensProvider.