fix: Honor ref expressions for compute_ref_match completions

This commit is contained in:
Lukas Wirth 2022-07-27 13:48:26 +02:00
parent 6c379b9f4b
commit 1f8daa180f
4 changed files with 75 additions and 23 deletions

View file

@ -391,3 +391,23 @@ fn foo($0: Foo) {}
expect![[r#"ty: ?, name: ?"#]],
);
}
#[test]
fn expected_type_ref_prefix_on_field() {
check_expected_type_and_name(
r#"
fn foo(_: &mut i32) {}
struct S {
field: i32,
}
fn main() {
let s = S {
field: 100,
};
foo(&mut s.f$0);
}
"#,
expect!["ty: i32, name: ?"],
);
}