Skip to content

Commit 5983f1e

Browse files
committed
search - Remove unused change event cases
1 parent d195206 commit 5983f1e

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

src/vs/workbench/contrib/search/browser/searchView.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -446,21 +446,13 @@ export class SearchView extends ViewletPanel {
446446
refreshTree(event?: IChangeEvent): void {
447447
const collapseResults = this.configurationService.getValue<ISearchConfigurationProperties>('search').collapseResults;
448448
if (!event || event.added || event.removed) {
449+
// Refresh whole tree
449450
this.tree.setChildren(null, this.createResultIterator(collapseResults));
450451
} else {
452+
// FileMatch modified, refresh those elements
451453
event.elements.forEach(element => {
452-
if (element instanceof BaseFolderMatch) {
453-
// The folder may or may not be in the tree. Refresh the whole thing.
454-
this.tree.setChildren(null, this.createResultIterator(collapseResults));
455-
return;
456-
}
457-
458-
if (element instanceof SearchResult) {
459-
this.tree.setChildren(null, this.createIterator(element, collapseResults));
460-
} else {
461-
this.tree.setChildren(element, this.createIterator(element, collapseResults));
462-
this.tree.rerender(element);
463-
}
454+
this.tree.setChildren(element, this.createIterator(element, collapseResults));
455+
this.tree.rerender(element);
464456
});
465457
}
466458
}

src/vs/workbench/contrib/search/common/searchModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export class FileMatch extends Disposable implements IFileMatch {
400400
}
401401

402402
export interface IChangeEvent {
403-
elements: (FileMatch | FolderMatch | SearchResult)[];
403+
elements: FileMatch[];
404404
added?: boolean;
405405
removed?: boolean;
406406
}

0 commit comments

Comments
 (0)