Skip to content

Commit 4c38824

Browse files
authored
Merge pull request microsoft#227013 from microsoft/andreamah/issue226916
Using cancellation with findTextInFilesNew
2 parents 12d9ce1 + 3e1258a commit 4c38824

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,10 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
664664
async findTextInFilesBase(query: vscode.TextSearchQuery, queryOptions: QueryOptions<ITextQueryBuilderOptions>[] | undefined, callback: (result: ITextSearchResult<URI>, uri: URI) => void, token: vscode.CancellationToken = CancellationToken.None): Promise<vscode.TextSearchComplete> {
665665
const requestId = this._requestIdProvider.getNext();
666666

667-
const isCanceled = false;
667+
let isCanceled = false;
668+
token.onCancellationRequested(_ => {
669+
isCanceled = true;
670+
});
668671

669672
this._activeSearchCallbacks[requestId] = p => {
670673
if (isCanceled) {

0 commit comments

Comments
 (0)