diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs index 79a9c6d87140..8b018c32fd4b 100644 --- a/crates/ide_completion/src/completions/attribute.rs +++ b/crates/ide_completion/src/completions/attribute.rs @@ -318,6 +318,26 @@ mod tests { expect.assert_eq(&actual); } + #[test] + fn test_attribute_completion_inside_nested_attr() { + check(r#"#[cfg($0)]"#, expect![[]]) + } + + #[test] + fn test_attribute_completion_with_existing_attr() { + check( + r#"#[no_mangle] #[$0] mcall!();"#, + expect![[r#" + at allow(…) + at cfg(…) + at cfg_attr(…) + at deny(…) + at forbid(…) + at warn(…) + "#]], + ) + } + #[test] fn complete_attribute_on_source_file() { check( @@ -731,9 +751,4 @@ mod tests { "#]], ); } - - #[test] - fn test_attribute_completion_inside_nested_attr() { - check(r#"#[cfg($0)]"#, expect![[]]) - } }