Skip to content

Commit 73d1aa9

Browse files
Attach the DB when mapping the result of world_symbols()
We call `try_to_nav()` there.
1 parent ff2b186 commit 73d1aa9

File tree

1 file changed

+9
-6
lines changed
  • src/tools/rust-analyzer/crates/ide/src

1 file changed

+9
-6
lines changed

src/tools/rust-analyzer/crates/ide/src/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,15 @@ impl Analysis {
481481
// `world_symbols` currently clones the database to run stuff in parallel, which will make any query panic
482482
// if we were to attach it here.
483483
Cancelled::catch(|| {
484-
symbol_index::world_symbols(&self.db, query)
485-
.into_iter()
486-
.filter_map(|s| s.try_to_nav(&self.db))
487-
.take(limit)
488-
.map(UpmappingResult::call_site)
489-
.collect::<Vec<_>>()
484+
let symbols = symbol_index::world_symbols(&self.db, query);
485+
salsa::attach(&self.db, || {
486+
symbols
487+
.into_iter()
488+
.filter_map(|s| s.try_to_nav(&self.db))
489+
.take(limit)
490+
.map(UpmappingResult::call_site)
491+
.collect::<Vec<_>>()
492+
})
490493
})
491494
}
492495

0 commit comments

Comments
 (0)