Using cancellation with findTextInFilesNew

Fixes #226916
pull/227013/head
andreamah 2024-08-28 14:17:07 -07:00
parent 2e4a043ef3
commit 3e1258a957
No known key found for this signature in database
GPG Key ID: B4CCC97963B6245C
1 changed files with 4 additions and 1 deletions

View File

@ -664,7 +664,10 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
async findTextInFilesBase(query: vscode.TextSearchQuery, queryOptions: QueryOptions<ITextQueryBuilderOptions>[] | undefined, callback: (result: ITextSearchResult<URI>, uri: URI) => void, token: vscode.CancellationToken = CancellationToken.None): Promise<vscode.TextSearchComplete> {
const requestId = this._requestIdProvider.getNext();
const isCanceled = false;
let isCanceled = false;
token.onCancellationRequested(_ => {
isCanceled = true;
});
this._activeSearchCallbacks[requestId] = p => {
if (isCanceled) {