Skip to content

Commit 034165a

Browse files
committed
don't cache provider results when request was cancelled, microsoft#74446
1 parent fae7dc6 commit 034165a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/vs/workbench/api/common/extHostLanguageFeatures.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,12 @@ class SuggestAdapter {
644644
return undefined;
645645
}
646646

647+
if (token.isCancellationRequested) {
648+
// cancelled -> return without further ado, esp no caching
649+
// of results as they will leak
650+
return undefined;
651+
}
652+
647653
let list = Array.isArray(value) ? new CompletionList(value) : value;
648654
let pid: number | undefined;
649655

@@ -832,6 +838,12 @@ class LinkProviderAdapter {
832838
return undefined;
833839
}
834840

841+
if (token.isCancellationRequested) {
842+
// cancelled -> return without further ado, esp no caching
843+
// of results as they will leak
844+
return undefined;
845+
}
846+
835847
if (typeof this._provider.resolveDocumentLink !== 'function') {
836848
// no resolve -> no caching
837849
return { links: links.map(typeConvert.DocumentLink.from) };

0 commit comments

Comments
 (0)