Skip to content

Commit a161fd6

Browse files
Merge pull request #20497 from ChayimFriedman2/symbols-attach2
Attach the DB when mapping the result of `world_symbols()`
2 parents 75ce5dc + 7a27a27 commit a161fd6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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)