@@ -53,7 +53,6 @@ pub struct Query {
5353 case_sensitive : bool ,
5454 only_types : bool ,
5555 libs : bool ,
56- include_hidden : bool ,
5756}
5857
5958impl Query {
@@ -67,14 +66,9 @@ impl Query {
6766 mode : SearchMode :: Fuzzy ,
6867 assoc_mode : AssocSearchMode :: Include ,
6968 case_sensitive : false ,
70- include_hidden : false ,
7169 }
7270 }
7371
74- pub fn include_hidden ( & mut self ) {
75- self . include_hidden = true ;
76- }
77-
7872 pub fn only_types ( & mut self ) {
7973 self . only_types = true ;
8074 }
@@ -363,6 +357,7 @@ impl Query {
363357 mut stream : fst:: map:: Union < ' _ > ,
364358 mut cb : impl FnMut ( & ' sym FileSymbol ) ,
365359 ) {
360+ let ignore_underscore_prefixed = !self . query . starts_with ( "__" ) ;
366361 while let Some ( ( _, indexed_values) ) = stream. next ( ) {
367362 for & IndexedValue { index, value } in indexed_values {
368363 let symbol_index = & indices[ index] ;
@@ -381,7 +376,8 @@ impl Query {
381376 if non_type_for_type_only_query || !self . matches_assoc_mode ( symbol. is_assoc ) {
382377 continue ;
383378 }
384- if self . should_hide_query ( symbol) {
379+ // Hide symbols that start with `__` unless the query starts with `__`
380+ if ignore_underscore_prefixed && symbol. name . starts_with ( "__" ) {
385381 continue ;
386382 }
387383 if self . mode . check ( & self . query , self . case_sensitive , & symbol. name ) {
@@ -392,11 +388,6 @@ impl Query {
392388 }
393389 }
394390
395- fn should_hide_query ( & self , symbol : & FileSymbol ) -> bool {
396- // Hide symbols that start with `__` unless the query starts with `__`
397- !self . include_hidden && symbol. name . starts_with ( "__" ) && !self . query . starts_with ( "__" )
398- }
399-
400391 fn matches_assoc_mode ( & self , is_trait_assoc_item : bool ) -> bool {
401392 !matches ! (
402393 ( is_trait_assoc_item, self . assoc_mode) ,
0 commit comments