Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/inlay_hints/adjustment.rs')
-rw-r--r--crates/ide/src/inlay_hints/adjustment.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/crates/ide/src/inlay_hints/adjustment.rs b/crates/ide/src/inlay_hints/adjustment.rs
index 39554d7777..e39a5f8889 100644
--- a/crates/ide/src/inlay_hints/adjustment.rs
+++ b/crates/ide/src/inlay_hints/adjustment.rs
@@ -10,7 +10,7 @@ use hir::{
Adjust, Adjustment, AutoBorrow, DisplayTarget, HirDisplay, Mutability, OverloadedDeref,
PointerCast, Safety,
};
-use ide_db::famous_defs::FamousDefs;
+use ide_db::{base_db::salsa, famous_defs::FamousDefs};
use ide_db::text_edit::TextEditBuilder;
use syntax::ast::{self, AstNode, prec::ExprPrecedence};
@@ -201,13 +201,15 @@ pub(super) fn hints(
text: if postfix { format!(".{}", text.trim_end()) } else { text.to_owned() },
linked_location: None,
tooltip: Some(config.lazy_tooltip(|| {
- InlayTooltip::Markdown(format!(
- "`{}` → `{}`\n\n**{}**\n\n{}",
- source.display(sema.db, display_target),
- target.display(sema.db, display_target),
- coercion,
- detailed_tooltip
- ))
+ salsa::attach(sema.db, || {
+ InlayTooltip::Markdown(format!(
+ "`{}` → `{}`\n\n**{}**\n\n{}",
+ source.display(sema.db, display_target),
+ target.display(sema.db, display_target),
+ coercion,
+ detailed_tooltip
+ ))
+ })
})),
};
if postfix { &mut post } else { &mut pre }.label.append_part(label);