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.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/item_list.rs b/crates/ide-completion/src/tests/item_list.rs
index fcdf10c856..ac32649d4f 100644
--- a/crates/ide-completion/src/tests/item_list.rs
+++ b/crates/ide-completion/src/tests/item_list.rs
@@ -458,6 +458,33 @@ type O = $0;
r"
struct A;
trait B {
+type O<'a>
+where
+Self: 'a;
+}
+impl B for A {
+$0
+}
+",
+ r#"
+struct A;
+trait B {
+type O<'a>
+where
+Self: 'a;
+}
+impl B for A {
+type O<'a> = $0
+where
+Self: 'a;
+}
+"#,
+ );
+ check_edit(
+ "type O",
+ r"
+struct A;
+trait B {
type O: ?Sized = u32;
}
impl B for A {
@@ -550,3 +577,30 @@ fn inside_extern_blocks() {
"#]],
)
}
+
+#[test]
+fn tokens_from_macro() {
+ check_edit(
+ "fn as_ref",
+ r#"
+//- proc_macros: identity
+//- minicore: as_ref
+struct Foo;
+
+#[proc_macros::identity]
+impl<'a> AsRef<&'a i32> for Foo {
+ $0
+}
+ "#,
+ r#"
+struct Foo;
+
+#[proc_macros::identity]
+impl<'a> AsRef<&'a i32> for Foo {
+ fn as_ref(&self) -> &&'a i32 {
+ $0
+}
+}
+ "#,
+ );
+}