diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index d3ed77cbf8d..3f6c11fe20a 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -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) };