mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
fix: Fix tuple- and record struct completions not working with existing braces
This commit is contained in:
parent
7370a6b5b8
commit
000e681d5f
4 changed files with 49 additions and 16 deletions
|
@ -552,3 +552,24 @@ fn func() {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn with_parens() {
|
||||
check_empty(
|
||||
r#"
|
||||
enum Enum {
|
||||
Variant()
|
||||
}
|
||||
impl Enum {
|
||||
fn variant() -> Self { Enum::Variant() }
|
||||
}
|
||||
fn func() {
|
||||
Enum::$0()
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
ev Variant(…) Variant
|
||||
fn variant fn() -> Enum
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -429,7 +429,9 @@ fn foo() {
|
|||
}
|
||||
}
|
||||
"#,
|
||||
expect![[r#""#]],
|
||||
expect![[r#"
|
||||
ev TupleVariant(…) TupleVariant
|
||||
"#]],
|
||||
);
|
||||
check_empty(
|
||||
r#"
|
||||
|
@ -442,7 +444,9 @@ fn foo() {
|
|||
}
|
||||
}
|
||||
"#,
|
||||
expect![[r#""#]],
|
||||
expect![[r#"
|
||||
ev RecordVariant {…} RecordVariant
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue