aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/attribute.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/completions/attribute.rs')
-rw-r--r--crates/ide_completion/src/completions/attribute.rs25
1 files changed, 20 insertions, 5 deletions
diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs
index 79a9c6d87..8b018c32f 100644
--- a/crates/ide_completion/src/completions/attribute.rs
+++ b/crates/ide_completion/src/completions/attribute.rs
@@ -319,6 +319,26 @@ mod tests {
319 } 319 }
320 320
321 #[test] 321 #[test]
322 fn test_attribute_completion_inside_nested_attr() {
323 check(r#"#[cfg($0)]"#, expect![[]])
324 }
325
326 #[test]
327 fn test_attribute_completion_with_existing_attr() {
328 check(
329 r#"#[no_mangle] #[$0] mcall!();"#,
330 expect![[r#"
331 at allow(…)
332 at cfg(…)
333 at cfg_attr(…)
334 at deny(…)
335 at forbid(…)
336 at warn(…)
337 "#]],
338 )
339 }
340
341 #[test]
322 fn complete_attribute_on_source_file() { 342 fn complete_attribute_on_source_file() {
323 check( 343 check(
324 r#"#![$0]"#, 344 r#"#![$0]"#,
@@ -731,9 +751,4 @@ mod tests {
731 "#]], 751 "#]],
732 ); 752 );
733 } 753 }
734
735 #[test]
736 fn test_attribute_completion_inside_nested_attr() {
737 check(r#"#[cfg($0)]"#, expect![[]])
738 }
739} 754}