Skip to content

Commit

Permalink
Auto merge of #17955 - ChayimFriedman2:fix-fast-search-with-scope, r=…
Browse files Browse the repository at this point in the history
…Veykril

fix: 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.

I forgot this while working on #17927.
  • Loading branch information
bors committed Aug 25, 2024
2 parents 74a6427 + b982783 commit 1271dff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/ide-db/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ impl<'a> FindUsages<'a> {
search_scope: &SearchScope,
name: &str,
) -> bool {
if self.scope.is_some() {
return false;
}

let _p = tracing::info_span!("short_associated_function_fast_search").entered();

let container = (|| {
Expand Down

0 comments on commit 1271dff

Please sign in to comment.