mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Merge pull request #20497 from ChayimFriedman2/symbols-attach2
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Attach the DB when mapping the result of `world_symbols()`
This commit is contained in:
commit
a161fd6bc1
1 changed files with 9 additions and 6 deletions
|
|
@ -481,12 +481,15 @@ impl Analysis {
|
|||
// `world_symbols` currently clones the database to run stuff in parallel, which will make any query panic
|
||||
// if we were to attach it here.
|
||||
Cancelled::catch(|| {
|
||||
symbol_index::world_symbols(&self.db, query)
|
||||
.into_iter()
|
||||
.filter_map(|s| s.try_to_nav(&self.db))
|
||||
.take(limit)
|
||||
.map(UpmappingResult::call_site)
|
||||
.collect::<Vec<_>>()
|
||||
let symbols = symbol_index::world_symbols(&self.db, query);
|
||||
salsa::attach(&self.db, || {
|
||||
symbols
|
||||
.into_iter()
|
||||
.filter_map(|s| s.try_to_nav(&self.db))
|
||||
.take(limit)
|
||||
.map(UpmappingResult::call_site)
|
||||
.collect::<Vec<_>>()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue