Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook-related bugfixes for quick search #191130

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<IPickerQuic

protected _getPicks(contentPattern: string, disposables: DisposableStore, token: CancellationToken): Picks<IQuickPickItem> | Promise<Picks<IQuickPickItem> | FastAndSlowPicks<IQuickPickItem>> | FastAndSlowPicks<IQuickPickItem> | null {

if (contentPattern === '') {
this.searchModel.searchResult.clear();
return [];
}
const allMatches = this.doSearch(contentPattern, token);

if (!allMatches) {
Expand Down
21 changes: 12 additions & 9 deletions src/vs/workbench/contrib/search/browser/searchModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1142,13 +1142,16 @@ export class FolderMatch extends Disposable {
raw.forEach(rawFileMatch => {
const existingFileMatch = this.getDownstreamFileMatch(rawFileMatch.resource);
if (existingFileMatch) {
rawFileMatch
.results!
.filter(resultIsMatch)
.forEach(m => {
textSearchResultToMatches(m, existingFileMatch)
.forEach(m => existingFileMatch.add(m));
});

if (rawFileMatch.results) {
rawFileMatch
.results
.filter(resultIsMatch)
.forEach(m => {
textSearchResultToMatches(m, existingFileMatch)
.forEach(m => existingFileMatch.add(m));
});
}

// add cell matches
if (isIFileMatchWithCells(rawFileMatch)) {
Expand Down Expand Up @@ -2009,7 +2012,7 @@ export class SearchModel extends Disposable {
} {
const asyncGenerateOnProgress = async (p: ISearchProgressItem) => {
progressEmitter.fire();
this.onSearchProgress(p, searchInstanceID);
this.onSearchProgress(p, searchInstanceID, false);
onProgress?.(p);
};

Expand All @@ -2020,7 +2023,7 @@ export class SearchModel extends Disposable {
};
const tokenSource = this.currentCancelTokenSource = new CancellationTokenSource(callerToken);

const notebookResult = this.notebookSearchService.notebookSearch(query, tokenSource.token, searchInstanceID, syncGenerateOnProgress);
const notebookResult = this.notebookSearchService.notebookSearch(query, tokenSource.token, searchInstanceID, asyncGenerateOnProgress);
const textResult = this.searchService.textSearchSplitSyncAsync(
searchQuery,
this.currentCancelTokenSource.token, asyncGenerateOnProgress,
Expand Down