Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/signature_help.rs')
-rw-r--r--crates/ide/src/signature_help.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/crates/ide/src/signature_help.rs b/crates/ide/src/signature_help.rs
index 382573b680..f45d096ac1 100644
--- a/crates/ide/src/signature_help.rs
+++ b/crates/ide/src/signature_help.rs
@@ -11,6 +11,7 @@ use hir::{
use ide_db::{
FilePosition, FxIndexMap,
active_parameter::{callable_for_arg_list, generic_def_for_node},
+ base_db::salsa,
documentation::{Documentation, HasDocs},
};
use itertools::Itertools;
@@ -266,12 +267,12 @@ fn signature_help_for_call(
// In that case, fall back to render definitions of the respective parameters.
// This is overly conservative: we do not substitute known type vars
// (see FIXME in tests::impl_trait) and falling back on any unknowns.
- match (p.ty().contains_unknown(), fn_params.as_deref()) {
+ salsa::attach(db, || match (p.ty().contains_unknown(), fn_params.as_deref()) {
(true, Some(fn_params)) => {
format_to!(buf, "{}", fn_params[idx].ty().display(db, display_target))
}
_ => format_to!(buf, "{}", p.ty().display(db, display_target)),
- }
+ });
res.push_call_param(&buf);
}
}
@@ -339,10 +340,6 @@ fn signature_help_for_generics(
res.doc = it.docs(db);
format_to!(res.signature, "trait {}", it.name(db).display(db, edition));
}
- hir::GenericDef::TraitAlias(it) => {
- res.doc = it.docs(db);
- format_to!(res.signature, "trait {}", it.name(db).display(db, edition));
- }
hir::GenericDef::TypeAlias(it) => {
res.doc = it.docs(db);
format_to!(res.signature, "type {}", it.name(db).display(db, edition));
@@ -733,7 +730,7 @@ fn signature_help_for_tuple_pat_ish<'db>(
mod tests {
use expect_test::{Expect, expect};
- use ide_db::FilePosition;
+ use ide_db::{FilePosition, base_db::salsa};
use stdx::format_to;
use test_fixture::ChangeFixture;
@@ -762,7 +759,7 @@ mod tests {
"#
);
let (db, position) = position(&fixture);
- let sig_help = crate::signature_help::signature_help(&db, position);
+ let sig_help = salsa::attach(&db, || crate::signature_help::signature_help(&db, position));
let actual = match sig_help {
Some(sig_help) => {
let mut rendered = String::new();