Can't disable full document semantic tokens request
See original GitHub issueI try to disable providing semantic tokens for a full document. But when I edit document, semanticTokens.on()
is allways trigger ,not semanticTokens.onRange()
.
codes:
connection.languages.semanticTokens.on((handler, token, workDoneProgress, resultProgress) => {
const t = Date.now();
try {
// ...
}
finally {
console.log(`semanticTokens.on, time: ${Date.now() - t}ms`);
}
})
connection.languages.semanticTokens.onRange((handler, token, workDoneProgress, resultProgress) => {
const t = Date.now();
try {
// ...
}
finally {
console.log(`semanticTokens.onRange, time: ${Date.now() - t}ms, lines: ${handler.range.start.line} ~ ${handler.range.end.line}`);
}
});
connection.client.register(SemanticTokensRegistrationType.type, {
// ...
range: true,
full: false, // <------------ disabled
});
log:
semanticTokens.onRange, time: 342ms, lines: 0 ~ 94
semanticTokens.on, time: 1447ms
semanticTokens.onRange, time: 21ms, lines: 0 ~ 93
semanticTokens.on, time: 2206ms
semanticTokens.on, time: 1419ms
semanticTokens.on, time: 1382ms
semanticTokens.on, time: 1435ms
semanticTokens.on, time: 1375ms
semanticTokens.on, time: 1372ms
semanticTokens.on, time: 1916ms
semanticTokens.on, time: 1937ms
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Semantic colorization requested for entire (large) file instead ...
So for the initial open of checker.ts , first the semantic tokens in the viewport will be fetched, and then the entire document...
Read more >Avoid doing semantic tokens for large files
100,000 bytes. After getting this error, vscode, at least, will stop asking for full requests and use range requests. ... are more than...
Read more >How to update semantic tokens as the visible range of the ...
To solve this issue, my idea was to check the editor's visible range as it changes when the user scrolls up and down,...
Read more >Publishing Extensions - Visual Studio Code
Learn how to publish Visual Studio Code extensions to the public Marketplace and share them with other developers.
Read more >GitLab CI/CD job token
After the job finishes, you can't use the token anymore. A job token can access a project's ... This setting is disabled by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The spec can’t force all clients to handle range only. There are clients out there that simply can’t implement this. This is why the spec behaves that way and it does in all other cases. So it is not a wrong design. It is on purpose!
This being said VS Code does support it and there was a problem in the library that didn’t call range in the absence of full. I fixed that.
I will try again with
npm run symlink:testbed
.