fix: Fix tuple- and record struct completions not working with existing braces

This commit is contained in:
Lukas Wirth 2022-03-21 21:45:29 +01:00
parent 7370a6b5b8
commit 000e681d5f
4 changed files with 49 additions and 16 deletions

View file

@ -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
"#]],
);
}

View file

@ -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
"#]],
);
}