@@ -593,11 +593,11 @@ class FindFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDi
593
593
}
594
594
595
595
filter ( element : T , parentVisibility : TreeVisibility ) : TreeFilterResult < FuzzyScore | LabelFuzzyScore > {
596
+ let visibility = TreeVisibility . Visible ;
597
+
596
598
if ( this . _filter ) {
597
599
const result = this . _filter . filter ( element , parentVisibility ) ;
598
600
599
- let visibility : TreeVisibility ;
600
-
601
601
if ( typeof result === 'boolean' ) {
602
602
visibility = result ? TreeVisibility . Visible : TreeVisibility . Hidden ;
603
603
} else if ( isFilterResult ( result ) ) {
@@ -615,7 +615,7 @@ class FindFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDi
615
615
616
616
if ( ! this . _pattern ) {
617
617
this . _matchCount ++ ;
618
- return { data : FuzzyScore . Default , visibility : true } ;
618
+ return { data : FuzzyScore . Default , visibility } ;
619
619
}
620
620
621
621
const label = this . keyboardNavigationLabelProvider . getKeyboardNavigationLabel ( element ) ;
@@ -624,22 +624,22 @@ class FindFilter<T> implements ITreeFilter<T, FuzzyScore | LabelFuzzyScore>, IDi
624
624
for ( const l of labels ) {
625
625
const labelStr = l && l . toString ( ) ;
626
626
if ( typeof labelStr === 'undefined' ) {
627
- return { data : FuzzyScore . Default , visibility : true } ;
627
+ return { data : FuzzyScore . Default , visibility } ;
628
628
}
629
629
630
630
const score = fuzzyScore ( this . _pattern , this . _lowercasePattern , 0 , labelStr , labelStr . toLowerCase ( ) , 0 , { firstMatchCanBeWeak : true , boostFullMatch : true } ) ;
631
631
if ( score ) {
632
632
this . _matchCount ++ ;
633
633
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 } ;
636
636
}
637
637
}
638
638
639
639
if ( this . tree . findMode === TreeFindMode . Filter ) {
640
640
return TreeVisibility . Recurse ;
641
641
} else {
642
- return { data : FuzzyScore . Default , visibility : true } ;
642
+ return { data : FuzzyScore . Default , visibility } ;
643
643
}
644
644
}
645
645
0 commit comments