Skip to content

Commit

Permalink
Solved bug regarding different substrings as search results.
Browse files Browse the repository at this point in the history
Fixes #7282
  • Loading branch information
jbicker committed Jun 10, 2020
1 parent 309b218 commit ef36e65
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,15 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget {
this.cancelIndicator = new CancellationTokenSource();
const cancelIndicator = this.cancelIndicator;
const token = this.cancelIndicator.token;
const progress = await this.progressService.showProgress({ text: `search: ${searchTerm}`, options: { location: 'search' } });
token.onCancellationRequested(() => {
this.changeEmitter.fire(this.resultTree);
progress.cancel();
if (searchId) {
this.searchService.cancel(searchId);
}
this.cancelIndicator = undefined;
});
const progress = await this.progressService.showProgress({ text: `search: ${searchTerm}`, options: { location: 'search' } });
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let pendingRefreshTimeout: any;
const searchId = await this.searchService.search(searchTerm, {
Expand Down Expand Up @@ -260,13 +265,6 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget {
this.refreshModelChildren();
}
}, searchOptions).catch(() => undefined);
token.onCancellationRequested(() => {
progress.cancel();
if (searchId) {
this.searchService.cancel(searchId);
}
this.cancelIndicator = undefined;
});
}

focusFirstResult(): void {
Expand Down

0 comments on commit ef36e65

Please sign in to comment.