don't cache provider results when request was cancelled, #74446

This commit is contained in:
Johannes Rieken
2019-05-28 12:15:41 +02:00
parent fae7dc6ff1
commit 034165ac67

View File

@@ -644,6 +644,12 @@ class SuggestAdapter {
return undefined;
}
if (token.isCancellationRequested) {
// cancelled -> return without further ado, esp no caching
// of results as they will leak
return undefined;
}
let list = Array.isArray(value) ? new CompletionList(value) : value;
let pid: number | undefined;
@@ -832,6 +838,12 @@ class LinkProviderAdapter {
return undefined;
}
if (token.isCancellationRequested) {
// cancelled -> return without further ado, esp no caching
// of results as they will leak
return undefined;
}
if (typeof this._provider.resolveDocumentLink !== 'function') {
// no resolve -> no caching
return { links: links.map(typeConvert.DocumentLink.from) };