diff options
Diffstat (limited to 'crates/ide_completion')
-rw-r--r-- | crates/ide_completion/src/completions/qualified_path.rs | 26 | ||||
-rw-r--r-- | crates/ide_completion/src/completions/unqualified_path.rs | 12 |
2 files changed, 32 insertions, 6 deletions
diff --git a/crates/ide_completion/src/completions/qualified_path.rs b/crates/ide_completion/src/completions/qualified_path.rs index 0b0a81410..58d4dd9ee 100644 --- a/crates/ide_completion/src/completions/qualified_path.rs +++ b/crates/ide_completion/src/completions/qualified_path.rs | |||
@@ -657,6 +657,32 @@ fn main() { let _ = crate::$0 } | |||
657 | } | 657 | } |
658 | 658 | ||
659 | #[test] | 659 | #[test] |
660 | fn does_not_complete_non_fn_macros() { | ||
661 | check( | ||
662 | r#" | ||
663 | mod m { | ||
664 | #[rustc_builtin_macro] | ||
665 | pub macro Clone {} | ||
666 | } | ||
667 | |||
668 | fn f() {m::$0} | ||
669 | "#, | ||
670 | expect![[r#""#]], | ||
671 | ); | ||
672 | check( | ||
673 | r#" | ||
674 | mod m { | ||
675 | #[rustc_builtin_macro] | ||
676 | pub macro bench {} | ||
677 | } | ||
678 | |||
679 | fn f() {m::$0} | ||
680 | "#, | ||
681 | expect![[r#""#]], | ||
682 | ); | ||
683 | } | ||
684 | |||
685 | #[test] | ||
660 | fn completes_in_assoc_item_list() { | 686 | fn completes_in_assoc_item_list() { |
661 | check( | 687 | check( |
662 | r#" | 688 | r#" |
diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index 1f6c4069f..b1e6b2b77 100644 --- a/crates/ide_completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs | |||
@@ -481,14 +481,14 @@ impl S { | |||
481 | ); | 481 | ); |
482 | check( | 482 | check( |
483 | r#" | 483 | r#" |
484 | mod m { | 484 | #[rustc_builtin_macro] |
485 | #[rustc_builtin_macro] | 485 | pub macro bench {} |
486 | pub macro Clone {} | ||
487 | } | ||
488 | 486 | ||
489 | fn f() {m::$0} | 487 | fn f() {$0} |
490 | "#, | 488 | "#, |
491 | expect![[r#""#]], | 489 | expect![[r#" |
490 | fn f() fn() | ||
491 | "#]], | ||
492 | ); | 492 | ); |
493 | } | 493 | } |
494 | 494 | ||