mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
Don't enable the search fast path for short associated functions when a search scope is set
In most places where we set a search scope it is a single file, and so the fast path will actually harm performance, since it has to search for aliases in the whole project. The only exception that qualifies for the fast path is SSR (there is an exception that don't qualify for the fast path as it search for `use` items). It sets the search scope to avoid dependencies. We could make it use the fast path, but I didn't bother.
This commit is contained in:
parent
74a6427861
commit
b98278307e
1 changed files with 4 additions and 0 deletions
|
@ -528,6 +528,10 @@ impl<'a> FindUsages<'a> {
|
||||||
search_scope: &SearchScope,
|
search_scope: &SearchScope,
|
||||||
name: &str,
|
name: &str,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
if self.scope.is_some() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let _p = tracing::info_span!("short_associated_function_fast_search").entered();
|
let _p = tracing::info_span!("short_associated_function_fast_search").entered();
|
||||||
|
|
||||||
let container = (|| {
|
let container = (|| {
|
||||||
|
|
Loading…
Reference in a new issue