mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-05 01:50:37 +00:00
Attach the DB when mapping the result of world_symbols()
We call `try_to_nav()` there.
This commit is contained in:
parent
75ce5dc2c9
commit
7a27a27f4b
1 changed files with 9 additions and 6 deletions
|
@ -481,13 +481,16 @@ impl Analysis {
|
||||||
// `world_symbols` currently clones the database to run stuff in parallel, which will make any query panic
|
// `world_symbols` currently clones the database to run stuff in parallel, which will make any query panic
|
||||||
// if we were to attach it here.
|
// if we were to attach it here.
|
||||||
Cancelled::catch(|| {
|
Cancelled::catch(|| {
|
||||||
symbol_index::world_symbols(&self.db, query)
|
let symbols = symbol_index::world_symbols(&self.db, query);
|
||||||
|
salsa::attach(&self.db, || {
|
||||||
|
symbols
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|s| s.try_to_nav(&self.db))
|
.filter_map(|s| s.try_to_nav(&self.db))
|
||||||
.take(limit)
|
.take(limit)
|
||||||
.map(UpmappingResult::call_site)
|
.map(UpmappingResult::call_site)
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the definitions from the symbol at `position`.
|
/// Returns the definitions from the symbol at `position`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue