fix: Fix completions not always working in for-loop patterns

This commit is contained in:
Lukas Wirth 2022-03-15 18:06:34 +01:00
parent fbc1d2a514
commit d5f8d91872
4 changed files with 63 additions and 17 deletions

View file

@ -76,8 +76,14 @@ fn after_target_name_in_impl() {
kw for
"#]],
);
// FIXME: This should emit `kw where`
check(r"impl Trait for Type $0", expect![[r#""#]]);
// FIXME: This should not emit `kw for`
check(
r"impl Trait for Type $0",
expect![[r#"
kw where
kw for
"#]],
);
}
#[test]

View file

@ -92,6 +92,16 @@ fn quux() {
"#,
expect![[r#""#]],
);
check_empty(
r#"
fn foo() {
for &$0 in () {}
}
"#,
expect![[r#"
kw mut
"#]],
);
}
#[test]