File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/search Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ export class FileMatch extends Disposable implements IFileMatch {
400400}
401401
402402export interface IChangeEvent {
403- elements : ( FileMatch | FolderMatch | SearchResult ) [ ] ;
403+ elements : FileMatch [ ] ;
404404 added ?: boolean ;
405405 removed ?: boolean ;
406406}
You can’t perform that action at this time.
0 commit comments