Skip to content

Commit cc69536

Browse files
committed
Auto merge of rust-lang#12202 - iDawer:ide.sig_help-fix, r=lnicola
fix: don't panic at fully qualified call syntax in signature help Closes rust-lang#12200 Regressed from rust-lang#12082
2 parents 460e389 + 956b8fb commit cc69536

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

crates/ide/src/signature_help.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn signature_help_for_call(
129129
hir::CallableKind::Function(func) => {
130130
res.doc = func.docs(db).map(|it| it.into());
131131
format_to!(res.signature, "fn {}", func.name(db));
132-
fn_params = Some(match func.self_param(db) {
132+
fn_params = Some(match callable.receiver_param(db) {
133133
Some(_self) => func.params_without_self(db),
134134
None => func.assoc_fn_params(db),
135135
});
@@ -1142,4 +1142,20 @@ fn f() {
11421142
"#]],
11431143
);
11441144
}
1145+
1146+
#[test]
1147+
fn fully_qualified_syntax() {
1148+
check(
1149+
r#"
1150+
fn f() {
1151+
trait A { fn foo(&self, other: Self); }
1152+
A::foo(&self$0, other);
1153+
}
1154+
"#,
1155+
expect![[r#"
1156+
fn foo(self: &Self, other: Self)
1157+
^^^^^^^^^^^ -----------
1158+
"#]],
1159+
);
1160+
}
11451161
}

0 commit comments

Comments
 (0)