Make pasting canceling ongoing geterr requests (#216089)

Should speed up pasting
This commit is contained in:
Matt Bierner 2024-06-19 10:22:00 -07:00 committed by GitHub
parent 8939d4f467
commit d662a014f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,13 +99,13 @@ class DocumentPasteProvider implements vscode.DocumentPasteEditProvider {
return;
}
const response = await this._client.execute('getPasteEdits', {
const response = await this._client.interruptGetErr(() => this._client.execute('getPasteEdits', {
file,
// TODO: only supports a single paste for now
pastedText: [text],
pasteLocations: ranges.map(typeConverters.Range.toTextSpan),
copiedFrom
}, token);
}, token));
if (response.type !== 'response' || !response.body || token.isCancellationRequested) {
return;
}