Allow searching with prefix
This commit is contained in:
parent
ada256c09e
commit
69e9d75678
1 changed files with 6 additions and 1 deletions
|
|
@ -381,7 +381,7 @@ impl Query {
|
|||
if non_type_for_type_only_query || !self.matches_assoc_mode(symbol.is_assoc) {
|
||||
continue;
|
||||
}
|
||||
if !self.include_hidden && symbol.name.starts_with("__") {
|
||||
if self.should_hide_query(&symbol) {
|
||||
continue;
|
||||
}
|
||||
if self.mode.check(&self.query, self.case_sensitive, &symbol.name) {
|
||||
|
|
@ -392,6 +392,11 @@ impl Query {
|
|||
}
|
||||
}
|
||||
|
||||
fn should_hide_query(&self, symbol: &FileSymbol) -> bool {
|
||||
// Hide symbols that start with `__` unless the query starts with `__`
|
||||
!self.include_hidden && symbol.name.starts_with("__") && !self.query.starts_with("__")
|
||||
}
|
||||
|
||||
fn matches_assoc_mode(&self, is_trait_assoc_item: bool) -> bool {
|
||||
!matches!(
|
||||
(is_trait_assoc_item, self.assoc_mode),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue