mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
fix: Honor ref expressions for compute_ref_match completions
This commit is contained in:
parent
6c379b9f4b
commit
1f8daa180f
4 changed files with 75 additions and 23 deletions
|
@ -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: ?"],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue