Skip to content

Commit 9577ca7

Browse files
Merge pull request #20502 from ChayimFriedman2/attach-db-3
Remove unnecessary `salsa::attach()` calls
2 parents a161fd6 + df375b0 commit 9577ca7

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

crates/ide/src/lib.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,7 @@ impl Analysis {
461461
hasher: impl Fn(&InlayHint) -> u64 + Send + UnwindSafe,
462462
) -> Cancellable<Option<InlayHint>> {
463463
self.with_db(|db| {
464-
salsa::attach(db, || {
465-
inlay_hints::inlay_hints_resolve(db, file_id, resolve_range, hash, config, hasher)
466-
})
464+
inlay_hints::inlay_hints_resolve(db, file_id, resolve_range, hash, config, hasher)
467465
})
468466
}
469467

@@ -533,9 +531,7 @@ impl Analysis {
533531
let search_scope = AssertUnwindSafe(search_scope);
534532
self.with_db(|db| {
535533
let _ = &search_scope;
536-
salsa::attach(db, || {
537-
references::find_all_refs(&Semantics::new(db), position, search_scope.0)
538-
})
534+
references::find_all_refs(&Semantics::new(db), position, search_scope.0)
539535
})
540536
}
541537

@@ -545,15 +541,15 @@ impl Analysis {
545541
config: &HoverConfig,
546542
range: FileRange,
547543
) -> Cancellable<Option<RangeInfo<HoverResult>>> {
548-
self.with_db(|db| salsa::attach(db, || hover::hover(db, range, config)))
544+
self.with_db(|db| hover::hover(db, range, config))
549545
}
550546

551547
/// Returns moniker of symbol at position.
552548
pub fn moniker(
553549
&self,
554550
position: FilePosition,
555551
) -> Cancellable<Option<RangeInfo<Vec<moniker::MonikerResult>>>> {
556-
self.with_db(|db| salsa::attach(db, || moniker::moniker(db, position)))
552+
self.with_db(|db| moniker::moniker(db, position))
557553
}
558554

559555
/// Returns URL(s) for the documentation of the symbol under the cursor.
@@ -581,7 +577,7 @@ impl Analysis {
581577
&self,
582578
position: FilePosition,
583579
) -> Cancellable<Option<RangeInfo<Vec<NavigationTarget>>>> {
584-
self.with_db(|db| salsa::attach(db, || call_hierarchy::call_hierarchy(db, position)))
580+
self.with_db(|db| call_hierarchy::call_hierarchy(db, position))
585581
}
586582

587583
/// Computes incoming calls for the given file position.
@@ -649,7 +645,7 @@ impl Analysis {
649645

650646
/// Returns the set of possible targets to run for the current file.
651647
pub fn runnables(&self, file_id: FileId) -> Cancellable<Vec<Runnable>> {
652-
self.with_db(|db| salsa::attach(db, || runnables::runnables(db, file_id)))
648+
self.with_db(|db| runnables::runnables(db, file_id))
653649
}
654650

655651
/// Returns the set of tests for the given file position.
@@ -672,9 +668,7 @@ impl Analysis {
672668
position: FilePosition,
673669
) -> Cancellable<Option<Vec<HighlightedRange>>> {
674670
self.with_db(|db| {
675-
salsa::attach(db, || {
676-
highlight_related::highlight_related(&Semantics::new(db), config, position)
677-
})
671+
highlight_related::highlight_related(&Semantics::new(db), config, position)
678672
})
679673
}
680674

0 commit comments

Comments
 (0)