Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/item_list.rs')
-rw-r--r--crates/ide-completion/src/tests/item_list.rs99
1 files changed, 99 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/item_list.rs b/crates/ide-completion/src/tests/item_list.rs
index c031856a70..0b2be0265f 100644
--- a/crates/ide-completion/src/tests/item_list.rs
+++ b/crates/ide-completion/src/tests/item_list.rs
@@ -211,6 +211,105 @@ fn after_visibility_unsafe() {
}
#[test]
+fn after_abi() {
+ check_with_base_items(
+ r#"extern "C" $0"#,
+ expect![[r#"
+ kw async
+ kw const
+ kw enum
+ kw fn
+ kw impl
+ kw impl for
+ kw mod
+ kw pub
+ kw pub(crate)
+ kw pub(super)
+ kw static
+ kw struct
+ kw trait
+ kw type
+ kw union
+ kw unsafe
+ kw use
+ "#]],
+ );
+ check_with_base_items(
+ r#"extern "C" f$0"#,
+ expect![[r#"
+ kw async
+ kw const
+ kw enum
+ kw fn
+ kw impl
+ kw impl for
+ kw mod
+ kw pub
+ kw pub(crate)
+ kw pub(super)
+ kw static
+ kw struct
+ kw trait
+ kw type
+ kw union
+ kw unsafe
+ kw use
+ "#]],
+ );
+}
+
+#[test]
+fn after_extern_token() {
+ check_with_base_items(
+ r#"extern $0"#,
+ expect![[r#"
+ kw async
+ kw const
+ kw crate
+ kw enum
+ kw fn
+ kw impl
+ kw impl for
+ kw mod
+ kw pub
+ kw pub(crate)
+ kw pub(super)
+ kw static
+ kw struct
+ kw trait
+ kw type
+ kw union
+ kw unsafe
+ kw use
+ "#]],
+ );
+ check_with_base_items(
+ r#"extern cr$0"#,
+ expect![[r#"
+ kw async
+ kw const
+ kw crate
+ kw enum
+ kw fn
+ kw impl
+ kw impl for
+ kw mod
+ kw pub
+ kw pub(crate)
+ kw pub(super)
+ kw static
+ kw struct
+ kw trait
+ kw type
+ kw union
+ kw unsafe
+ kw use
+ "#]],
+ );
+ check_edit("crate", "extern $0", "extern crate $0;");
+}
+
+#[test]
fn in_impl_assoc_item_list() {
check_with_base_items(
r#"impl Struct { $0 }"#,