Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover/tests.rs')
| -rw-r--r-- | crates/ide/src/hover/tests.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs index 4187e9ca36..f1d7d2791d 100644 --- a/crates/ide/src/hover/tests.rs +++ b/crates/ide/src/hover/tests.rs @@ -4277,3 +4277,46 @@ pub struct Foo; "#]], ); } + +#[test] +fn hover_inert_attr() { + check( + r#" +#[doc$0 = ""] +pub struct Foo; +"#, + expect![[r##" + *doc* + + ```rust + #[doc] + ``` + + --- + + Valid forms are: + + * \#\[doc(hidden|inline|...)\] + * \#\[doc = string\] + "##]], + ); + check( + r#" +#[allow$0()] +pub struct Foo; +"#, + expect![[r##" + *allow* + + ```rust + #[allow] + ``` + + --- + + Valid forms are: + + * \#\[allow(lint1, lint2, ..., /\*opt\*/ reason = "...")\] + "##]], + ); +} |