Skip to content

Commit

Permalink
Fix #86497 by returing localResults instead of just triggering onProg…
Browse files Browse the repository at this point in the history
…ress with them
  • Loading branch information
Jackson Kearl committed Dec 13, 2019
1 parent 8ad11f8 commit 6e0f97c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vs/workbench/services/search/common/searchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class SearchService extends Disposable implements ISearchService {
});
}

textSearch(query: ITextQuery, token?: CancellationToken, onProgress?: (item: ISearchProgressItem) => void): Promise<ISearchComplete> {
async textSearch(query: ITextQuery, token?: CancellationToken, onProgress?: (item: ISearchProgressItem) => void): Promise<ISearchComplete> {
// Get local results from dirty/untitled
const localResults = this.getLocalResults(query);

Expand All @@ -83,7 +83,11 @@ export class SearchService extends Disposable implements ISearchService {
}
};

return this.doSearch(query, token, onProviderProgress);
const otherResults = await this.doSearch(query, token, onProviderProgress);
return {
...otherResults,
results: [...otherResults.results, ...arrays.coalesce(localResults.values())]
};
}

fileSearch(query: IFileQuery, token?: CancellationToken): Promise<ISearchComplete> {
Expand Down

1 comment on commit 6e0f97c

@JacksonKearl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.