@@ -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
@@ -1023,6 +1023,7 @@ export interface IAbstractTreeOptions<T, TFilterData = void> extends IAbstractTr
10231023 readonly filter ?: ITreeFilter < T , TFilterData > ;
10241024 readonly dnd ?: ITreeDragAndDrop < T > ;
10251025 readonly additionalScrollHeight ?: number ;
1026+ readonly findWidgetEnabled ?: boolean ;
10261027}
10271028
10281029function dfs < T , TFilterData > ( node : ITreeNode < T , TFilterData > , fn : ( node : ITreeNode < T , TFilterData > ) => void ) : void {
@@ -1437,7 +1438,7 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
14371438 onKeyDown . filter ( e => e . keyCode === KeyCode . Space ) . on ( this . onSpace , this , this . disposables ) ;
14381439 }
14391440
1440- if ( _options . keyboardNavigationLabelProvider && _options . contextViewProvider ) {
1441+ if ( ( _options . findWidgetEnabled ?? true ) && _options . keyboardNavigationLabelProvider && _options . contextViewProvider ) {
14411442 this . findController = new FindController ( this , this . model , this . view , filter ! , _options . contextViewProvider ) ;
14421443 this . focusNavigationFilter = node => this . findController ! . shouldAllowFocus ( node ) ;
14431444 this . onDidChangeFindOpenState = this . findController . onDidChangeOpenState ;
0 commit comments