Merge pull request #227013 from microsoft/andreamah/issue226916

Using cancellation with findTextInFilesNew
pull/227019/head
Andrea Mah 2024-08-28 14:50:25 -07:00 committed by GitHub
commit 4c388245ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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) {