mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
Remove unnecessary salsa::attach() calls
This commit is contained in:
parent
a161fd6bc1
commit
df375b0855
1 changed files with 7 additions and 13 deletions
|
|
@ -461,9 +461,7 @@ impl Analysis {
|
|||
hasher: impl Fn(&InlayHint) -> u64 + Send + UnwindSafe,
|
||||
) -> Cancellable<Option<InlayHint>> {
|
||||
self.with_db(|db| {
|
||||
salsa::attach(db, || {
|
||||
inlay_hints::inlay_hints_resolve(db, file_id, resolve_range, hash, config, hasher)
|
||||
})
|
||||
inlay_hints::inlay_hints_resolve(db, file_id, resolve_range, hash, config, hasher)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -533,9 +531,7 @@ impl Analysis {
|
|||
let search_scope = AssertUnwindSafe(search_scope);
|
||||
self.with_db(|db| {
|
||||
let _ = &search_scope;
|
||||
salsa::attach(db, || {
|
||||
references::find_all_refs(&Semantics::new(db), position, search_scope.0)
|
||||
})
|
||||
references::find_all_refs(&Semantics::new(db), position, search_scope.0)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -545,7 +541,7 @@ impl Analysis {
|
|||
config: &HoverConfig,
|
||||
range: FileRange,
|
||||
) -> Cancellable<Option<RangeInfo<HoverResult>>> {
|
||||
self.with_db(|db| salsa::attach(db, || hover::hover(db, range, config)))
|
||||
self.with_db(|db| hover::hover(db, range, config))
|
||||
}
|
||||
|
||||
/// Returns moniker of symbol at position.
|
||||
|
|
@ -553,7 +549,7 @@ impl Analysis {
|
|||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancellable<Option<RangeInfo<Vec<moniker::MonikerResult>>>> {
|
||||
self.with_db(|db| salsa::attach(db, || moniker::moniker(db, position)))
|
||||
self.with_db(|db| moniker::moniker(db, position))
|
||||
}
|
||||
|
||||
/// Returns URL(s) for the documentation of the symbol under the cursor.
|
||||
|
|
@ -581,7 +577,7 @@ impl Analysis {
|
|||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancellable<Option<RangeInfo<Vec<NavigationTarget>>>> {
|
||||
self.with_db(|db| salsa::attach(db, || call_hierarchy::call_hierarchy(db, position)))
|
||||
self.with_db(|db| call_hierarchy::call_hierarchy(db, position))
|
||||
}
|
||||
|
||||
/// Computes incoming calls for the given file position.
|
||||
|
|
@ -649,7 +645,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| salsa::attach(db, || runnables::runnables(db, file_id)))
|
||||
self.with_db(|db| runnables::runnables(db, file_id))
|
||||
}
|
||||
|
||||
/// Returns the set of tests for the given file position.
|
||||
|
|
@ -672,9 +668,7 @@ impl Analysis {
|
|||
position: FilePosition,
|
||||
) -> Cancellable<Option<Vec<HighlightedRange>>> {
|
||||
self.with_db(|db| {
|
||||
salsa::attach(db, || {
|
||||
highlight_related::highlight_related(&Semantics::new(db), config, position)
|
||||
})
|
||||
highlight_related::highlight_related(&Semantics::new(db), config, position)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue