Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r--crates/ide/src/lib.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index 5349ebb7c8..e491c9214b 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -67,7 +67,7 @@ use ide_db::{
FxHashMap, FxIndexSet, LineIndexDatabase,
base_db::{
CrateOrigin, CrateWorkspaceData, Env, FileSet, RootQueryDb, SourceDatabase, VfsPath,
- salsa::Cancelled,
+ salsa::{self, Cancelled},
},
prime_caches, symbol_index,
};
@@ -461,7 +461,9 @@ impl Analysis {
hasher: impl Fn(&InlayHint) -> u64 + Send + UnwindSafe,
) -> Cancellable<Option<InlayHint>> {
self.with_db(|db| {
- inlay_hints::inlay_hints_resolve(db, file_id, resolve_range, hash, config, hasher)
+ salsa::attach(db, || {
+ inlay_hints::inlay_hints_resolve(db, file_id, resolve_range, hash, config, hasher)
+ })
})
}
@@ -526,7 +528,9 @@ impl Analysis {
let search_scope = AssertUnwindSafe(search_scope);
self.with_db(|db| {
let _ = &search_scope;
- references::find_all_refs(&Semantics::new(db), position, search_scope.0)
+ salsa::attach(db, || {
+ references::find_all_refs(&Semantics::new(db), position, search_scope.0)
+ })
})
}
@@ -536,7 +540,7 @@ impl Analysis {
config: &HoverConfig,
range: FileRange,
) -> Cancellable<Option<RangeInfo<HoverResult>>> {
- self.with_db(|db| hover::hover(db, range, config))
+ self.with_db(|db| salsa::attach(db, || hover::hover(db, range, config)))
}
/// Returns moniker of symbol at position.
@@ -544,7 +548,7 @@ impl Analysis {
&self,
position: FilePosition,
) -> Cancellable<Option<RangeInfo<Vec<moniker::MonikerResult>>>> {
- self.with_db(|db| moniker::moniker(db, position))
+ self.with_db(|db| salsa::attach(db, || moniker::moniker(db, position)))
}
/// Returns URL(s) for the documentation of the symbol under the cursor.
@@ -572,7 +576,7 @@ impl Analysis {
&self,
position: FilePosition,
) -> Cancellable<Option<RangeInfo<Vec<NavigationTarget>>>> {
- self.with_db(|db| call_hierarchy::call_hierarchy(db, position))
+ self.with_db(|db| salsa::attach(db, || call_hierarchy::call_hierarchy(db, position)))
}
/// Computes incoming calls for the given file position.
@@ -640,7 +644,7 @@ impl Analysis {
/// Returns the set of possible targets to run for the current file.
pub fn runnables(&self, file_id: FileId) -> Cancellable<Vec<Runnable>> {
- self.with_db(|db| runnables::runnables(db, file_id))
+ self.with_db(|db| salsa::attach(db, || runnables::runnables(db, file_id)))
}
/// Returns the set of tests for the given file position.
@@ -672,7 +676,9 @@ impl Analysis {
position: FilePosition,
) -> Cancellable<Option<Vec<HighlightedRange>>> {
self.with_db(|db| {
- highlight_related::highlight_related(&Semantics::new(db), config, position)
+ salsa::attach(db, || {
+ highlight_related::highlight_related(&Semantics::new(db), config, position)
+ })
})
}