mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Recognize __
prefixes for symbol search query
This commit is contained in:
parent
042bd0b78d
commit
0110cfcae0
2 changed files with 8 additions and 16 deletions
|
@ -940,11 +940,12 @@ static __FOO_CALLSITE: () = ();
|
|||
// It doesn't show the hidden symbol
|
||||
let navs = analysis.symbol_search(Query::new("foo".to_owned()), !0).unwrap();
|
||||
assert_eq!(navs.len(), 2);
|
||||
let navs = analysis.symbol_search(Query::new("_foo".to_owned()), !0).unwrap();
|
||||
assert_eq!(navs.len(), 0);
|
||||
|
||||
// Unless we configure a query to show hidden symbols
|
||||
let mut query = Query::new("foo".to_owned());
|
||||
query.include_hidden();
|
||||
// Unless we explicitly search for a `__` prefix
|
||||
let query = Query::new("__foo".to_owned());
|
||||
let navs = analysis.symbol_search(query, !0).unwrap();
|
||||
assert_eq!(navs.len(), 3);
|
||||
assert_eq!(navs.len(), 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue