@@ -593,11 +593,11 @@ class FindFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDi
593593 }
594594
595595 filter ( element : T , parentVisibility : TreeVisibility ) : TreeFilterResult < FuzzyScore | LabelFuzzyScore > {
596+ let visibility = TreeVisibility . Visible ;
597+
596598 if ( this . _filter ) {
597599 const result = this . _filter . filter ( element , parentVisibility ) ;
598600
599- let visibility : TreeVisibility ;
600-
601601 if ( typeof result === 'boolean' ) {
602602 visibility = result ? TreeVisibility . Visible : TreeVisibility . Hidden ;
603603 } else if ( isFilterResult ( result ) ) {
@@ -615,7 +615,7 @@ class FindFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDi
615615
616616 if ( ! this . _pattern ) {
617617 this . _matchCount ++ ;
618- return { data : FuzzyScore . Default , visibility : true } ;
618+ return { data : FuzzyScore . Default , visibility } ;
619619 }
620620
621621 const label = this . keyboardNavigationLabelProvider . getKeyboardNavigationLabel ( element ) ;
@@ -624,22 +624,22 @@ class FindFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDi
624624 for ( const l of labels ) {
625625 const labelStr = l && l . toString ( ) ;
626626 if ( typeof labelStr === 'undefined' ) {
627- return { data : FuzzyScore . Default , visibility : true } ;
627+ return { data : FuzzyScore . Default , visibility } ;
628628 }
629629
630630 const score = fuzzyScore ( this . _pattern , this . _lowercasePattern , 0 , labelStr , labelStr . toLowerCase ( ) , 0 , { firstMatchCanBeWeak : true , boostFullMatch : true } ) ;
631631 if ( score ) {
632632 this . _matchCount ++ ;
633633 return labels . length === 1 ?
634- { data : score , visibility : true } :
635- { data : { label : labelStr , score : score } , visibility : true } ;
634+ { data : score , visibility } :
635+ { data : { label : labelStr , score : score } , visibility } ;
636636 }
637637 }
638638
639639 if ( this . tree . findMode === TreeFindMode . Filter ) {
640640 return TreeVisibility . Recurse ;
641641 } else {
642- return { data : FuzzyScore . Default , visibility : true } ;
642+ return { data : FuzzyScore . Default , visibility } ;
643643 }
644644 }
645645
0 commit comments