Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index a48fe43e80..fc45dc3faf 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -581,11 +581,13 @@ fn goto_type_action_for_def(
});
}
- if let Ok(generic_def) = GenericDef::try_from(def) {
- generic_def.type_or_const_params(db).into_iter().for_each(|it| {
- walk_and_push_ty(db, &it.ty(db), &mut push_new_def);
- });
- }
+ salsa::attach(db, || {
+ if let Ok(generic_def) = GenericDef::try_from(def) {
+ generic_def.type_or_const_params(db).into_iter().for_each(|it| {
+ walk_and_push_ty(db, &it.ty(db), &mut push_new_def);
+ });
+ }
+ });
let ty = match def {
Definition::Local(it) => Some(it.ty(db)),