mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Fixes #89552: Throw from the provider when semantic tokens cannot be computed and keep old semantic tokens if this happens
This commit is contained in:
@@ -80,7 +80,11 @@ class DocumentSemanticTokensProvider implements vscode.DocumentSemanticTokensPro
|
||||
if (versionBeforeRequest !== versionAfterRequest) {
|
||||
// cannot convert result's offsets to (line;col) values correctly
|
||||
// a new request will come in soon...
|
||||
return null;
|
||||
//
|
||||
// here we cannot return null, because returning null would remove all semantic tokens.
|
||||
// we must throw to indicate that the semantic tokens should not be removed.
|
||||
// using the string busy here because it is not logged to error telemetry if the error text contains busy.
|
||||
throw new Error('busy');
|
||||
}
|
||||
|
||||
const tokenSpan = response.body.spans;
|
||||
|
||||
Reference in New Issue
Block a user