Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/tests/attribute.rs')
| -rw-r--r-- | crates/ide_completion/src/tests/attribute.rs | 143 |
1 files changed, 73 insertions, 70 deletions
diff --git a/crates/ide_completion/src/tests/attribute.rs b/crates/ide_completion/src/tests/attribute.rs index ac43a67bdc..5a9c48a327 100644 --- a/crates/ide_completion/src/tests/attribute.rs +++ b/crates/ide_completion/src/tests/attribute.rs @@ -18,6 +18,9 @@ struct Foo; "#, expect![[r#" md proc_macros + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -33,9 +36,6 @@ struct Foo; at derive(…) at repr(…) at non_exhaustive - kw self - kw super - kw crate "#]], ) } @@ -61,7 +61,10 @@ fn proc_macros_qualified() { #[proc_macros::$0] struct Foo; "#, - expect![[r#""#]], + expect![[r#" + at input_replace pub macro input_replace + at identity pub macro identity + "#]], ) } @@ -75,15 +78,15 @@ fn with_existing_attr() { check( r#"#[no_mangle] #[$0] mcall!();"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) at deny(…) at forbid(…) at warn(…) - kw self - kw super - kw crate "#]], ) } @@ -93,6 +96,9 @@ fn attr_on_source_file() { check( r#"#![$0]"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -113,9 +119,6 @@ fn attr_on_source_file() { at recursion_limit = "…" at type_length_limit = … at windows_subsystem = "…" - kw self - kw super - kw crate "#]], ); } @@ -125,6 +128,9 @@ fn attr_on_module() { check( r#"#[$0] mod foo;"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -139,14 +145,14 @@ fn attr_on_module() { at no_mangle at macro_use at path = "…" - kw self - kw super - kw crate "#]], ); check( r#"mod foo {#![$0]}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -160,9 +166,6 @@ fn attr_on_module() { at must_use at no_mangle at no_implicit_prelude - kw self - kw super - kw crate "#]], ); } @@ -172,6 +175,9 @@ fn attr_on_macro_rules() { check( r#"#[$0] macro_rules! foo {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -186,9 +192,6 @@ fn attr_on_macro_rules() { at no_mangle at macro_export at macro_use - kw self - kw super - kw crate "#]], ); } @@ -198,6 +201,9 @@ fn attr_on_macro_def() { check( r#"#[$0] macro foo {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -210,9 +216,6 @@ fn attr_on_macro_def() { at doc(alias = "…") at must_use at no_mangle - kw self - kw super - kw crate "#]], ); } @@ -222,6 +225,9 @@ fn attr_on_extern_crate() { check( r#"#[$0] extern crate foo;"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -235,9 +241,6 @@ fn attr_on_extern_crate() { at must_use at no_mangle at macro_use - kw self - kw super - kw crate "#]], ); } @@ -247,6 +250,9 @@ fn attr_on_use() { check( r#"#[$0] use foo;"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -259,9 +265,6 @@ fn attr_on_use() { at doc(alias = "…") at must_use at no_mangle - kw self - kw super - kw crate "#]], ); } @@ -271,6 +274,9 @@ fn attr_on_type_alias() { check( r#"#[$0] type foo = ();"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -283,9 +289,6 @@ fn attr_on_type_alias() { at doc(alias = "…") at must_use at no_mangle - kw self - kw super - kw crate "#]], ); } @@ -301,6 +304,9 @@ struct Foo; expect![[r#" md core at derive pub macro derive + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -316,9 +322,6 @@ struct Foo; at derive(…) at repr(…) at non_exhaustive - kw self - kw super - kw crate "#]], ); } @@ -328,6 +331,9 @@ fn attr_on_enum() { check( r#"#[$0] enum Foo {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -343,9 +349,6 @@ fn attr_on_enum() { at derive(…) at repr(…) at non_exhaustive - kw self - kw super - kw crate "#]], ); } @@ -355,6 +358,9 @@ fn attr_on_const() { check( r#"#[$0] const FOO: () = ();"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -367,9 +373,6 @@ fn attr_on_const() { at doc(alias = "…") at must_use at no_mangle - kw self - kw super - kw crate "#]], ); } @@ -379,6 +382,9 @@ fn attr_on_static() { check( r#"#[$0] static FOO: () = ()"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -396,9 +402,6 @@ fn attr_on_static() { at link_section = "…" at global_allocator at used - kw self - kw super - kw crate "#]], ); } @@ -408,6 +411,9 @@ fn attr_on_trait() { check( r#"#[$0] trait Foo {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -421,9 +427,6 @@ fn attr_on_trait() { at must_use at no_mangle at must_use - kw self - kw super - kw crate "#]], ); } @@ -433,6 +436,9 @@ fn attr_on_impl() { check( r#"#[$0] impl () {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -446,14 +452,14 @@ fn attr_on_impl() { at must_use at no_mangle at automatically_derived - kw self - kw super - kw crate "#]], ); check( r#"impl () {#![$0]}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -466,9 +472,6 @@ fn attr_on_impl() { at doc(alias = "…") at must_use at no_mangle - kw self - kw super - kw crate "#]], ); } @@ -478,6 +481,9 @@ fn attr_on_extern_block() { check( r#"#[$0] extern {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -491,14 +497,14 @@ fn attr_on_extern_block() { at must_use at no_mangle at link - kw self - kw super - kw crate "#]], ); check( r#"extern {#![$0]}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -512,9 +518,6 @@ fn attr_on_extern_block() { at must_use at no_mangle at link - kw self - kw super - kw crate "#]], ); } @@ -524,6 +527,9 @@ fn attr_on_variant() { check( r#"enum Foo { #[$0] Bar }"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -531,9 +537,6 @@ fn attr_on_variant() { at forbid(…) at warn(…) at non_exhaustive - kw self - kw super - kw crate "#]], ); } @@ -543,6 +546,9 @@ fn attr_on_fn() { check( r#"#[$0] fn main() {}"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) @@ -570,9 +576,6 @@ fn attr_on_fn() { at target_feature = "…" at test at track_caller - kw self - kw super - kw crate "#]], ); } @@ -583,15 +586,15 @@ fn attr_on_expr() { check( r#"fn main() { #[$0] foo() }"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at cfg(…) at cfg_attr(…) at deny(…) at forbid(…) at warn(…) - kw self - kw super - kw crate "#]], ); } @@ -601,6 +604,9 @@ fn attr_in_source_file_end() { check( r#"#[$0]"#, expect![[r#" + kw self:: + kw super:: + kw crate:: at allow(…) at automatically_derived at cfg(…) @@ -637,9 +643,6 @@ fn attr_in_source_file_end() { at track_caller at used at warn(…) - kw self - kw super - kw crate "#]], ); } |