about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2025-08-21 08:06:43 +0300
committerChayim Refael Friedman <chayimfr@gmail.com>2025-08-21 08:06:43 +0300
commit73d1aa9e8248d22cc6425714b9f3f44d34257e7a (patch)
treeec9db397f525bbfc51a70acd0866e82e214f74ad
parentff2b1868b937837f86be404867f25779ec1112d7 (diff)
downloadrust-73d1aa9e8248d22cc6425714b9f3f44d34257e7a.tar.gz
rust-73d1aa9e8248d22cc6425714b9f3f44d34257e7a.zip
Attach the DB when mapping the result of `world_symbols()`
We call `try_to_nav()` there.
-rw-r--r--src/tools/rust-analyzer/crates/ide/src/lib.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/lib.rs b/src/tools/rust-analyzer/crates/ide/src/lib.rs
index 874e04702e2..4b93535c894 100644
--- a/src/tools/rust-analyzer/crates/ide/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/lib.rs
@@ -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<_>>()
+            })
         })
     }