Hookup semantic tokens range refresh notification to the viewport contribution#271419
Merged
alexdima merged 2 commits intomicrosoft:mainfrom Oct 24, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where semantic tokens range refresh notifications were not properly hooked up to the viewport semantic tokens contribution, preventing actual refresh when providers fire their onDidChange events.
Key changes:
- Adds event listener registration for provider onDidChange events in the viewport semantic tokens contribution
- Includes comprehensive test coverage to verify the fix works correctly
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts | Implements the core fix by adding change listener management for range providers |
| src/vs/editor/contrib/semanticTokens/test/browser/viewportSemanticTokens.test.ts | Adds test coverage to verify provider onDidChange events trigger viewport refresh |
src/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.ts
Outdated
Show resolved
Hide resolved
Member
Author
|
@alexdima let me know if there is anything I can do to move this forward - would like to try and get this working in the oct update as there is a bit of a chain of dependencies that need to update |
Contributor
|
@alexdima Can you have a look? |
Tyriar
approved these changes
Oct 24, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves #268140
The semantic tokens range refresh event was introduced recently in #268148 however it looks like it was not hooked up to the viewportSemanticTokens part, and so didn't actually refresh. Took a stab at fixing it and adding a test for it. Used the document provider as inspiration here - https://github.com/microsoft/vscode/blob/main/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.ts#L153
Also tested with dibarbet/vscode-extension-samples@59cd751 to make sure it works
refresh_semantic_tokens.mov