Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/item.rs')
-rw-r--r--crates/ide-completion/src/tests/item.rs86
1 files changed, 43 insertions, 43 deletions
diff --git a/crates/ide-completion/src/tests/item.rs b/crates/ide-completion/src/tests/item.rs
index 537c9a7fa2..81303eb38f 100644
--- a/crates/ide-completion/src/tests/item.rs
+++ b/crates/ide-completion/src/tests/item.rs
@@ -76,65 +76,65 @@ fn after_target_name_in_impl() {
kw where
"#]],
);
- // FIXME: This should not emit `kw for`
check(
- r"impl Trait for Type $0",
+ r"impl Trait f$0",
expect![[r#"
kw for
kw where
"#]],
);
-}
-
-#[test]
-fn after_struct_name() {
- // FIXME: This should emit `kw where` only
check(
- r"struct Struct $0",
+ r"impl Trait for Type $0",
expect![[r#"
- kw const
- kw enum
- kw extern
- kw fn
- kw impl
- kw mod
- kw pub
- kw pub(crate)
- kw pub(super)
- kw static
- kw struct
- kw trait
- kw type
- kw union
- kw unsafe
- kw use
+ kw where
"#]],
);
}
#[test]
-fn after_fn_name() {
- // FIXME: This should emit `kw where` only
+fn completes_where() {
+ check(
+ r"struct Struct $0",
+ expect![[r#"
+ kw where
+ "#]],
+ );
+ check(
+ r"struct Struct $0 {}",
+ expect![[r#"
+ kw where
+ "#]],
+ );
+ // FIXME: This shouldn't be completed here
+ check(
+ r"struct Struct $0 ()",
+ expect![[r#"
+ kw where
+ "#]],
+ );
check(
r"fn func() $0",
expect![[r#"
- kw const
- kw enum
- kw extern
- kw fn
- kw impl
- kw mod
- kw pub
- kw pub(crate)
- kw pub(super)
- kw static
- kw struct
- kw trait
- kw type
- kw union
- kw unsafe
- kw use
- "#]],
+ kw where
+ "#]],
+ );
+ check(
+ r"enum Enum $0",
+ expect![[r#"
+ kw where
+ "#]],
+ );
+ check(
+ r"enum Enum $0 {}",
+ expect![[r#"
+ kw where
+ "#]],
+ );
+ check(
+ r"trait Trait $0 {}",
+ expect![[r#"
+ kw where
+ "#]],
);
}