Bring back version check to avoid flickering caused by coordinates conversion
This commit is contained in:
parent
79253d4cb1
commit
fbc1c189ff
|
@ -68,11 +68,21 @@ class DocumentSemanticTokensProvider implements vscode.DocumentSemanticTokensPro
|
|||
return null;
|
||||
}
|
||||
|
||||
const versionBeforeRequest = document.version;
|
||||
|
||||
const response = await (this.client as ExperimentalProtocol.IExtendedTypeScriptServiceClient).execute('encodedSemanticClassifications-full', requestArg, token);
|
||||
if (response.type !== 'response' || !response.body) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const versionAfterRequest = document.version;
|
||||
|
||||
if (versionBeforeRequest !== versionAfterRequest) {
|
||||
// cannot convert result's offsets to (line;col) values correctly
|
||||
// a new request will come in soon...
|
||||
return null;
|
||||
}
|
||||
|
||||
const tokenSpan = response.body.spans;
|
||||
|
||||
const builder = new vscode.SemanticTokensBuilder();
|
||||
|
|
Loading…
Reference in a new issue