diff options
-rw-r--r-- | crates/completion/src/completions/unqualified_path.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 12cdb869d..7ba99447d 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -517,6 +517,37 @@ mod prelude { struct Option; } | |||
517 | } | 517 | } |
518 | 518 | ||
519 | #[test] | 519 | #[test] |
520 | fn completes_prelude_macros() { | ||
521 | check( | ||
522 | r#" | ||
523 | //- /main.rs crate:main deps:std | ||
524 | fn f() {$0} | ||
525 | |||
526 | //- /std/lib.rs crate:std | ||
527 | #[prelude_import] | ||
528 | pub use prelude::*; | ||
529 | |||
530 | #[macro_use] | ||
531 | mod prelude { | ||
532 | pub use crate::concat; | ||
533 | } | ||
534 | |||
535 | mod macros { | ||
536 | #[rustc_builtin_macro] | ||
537 | #[macro_export] | ||
538 | macro_rules! concat { } | ||
539 | } | ||
540 | "#, | ||
541 | expect![[r##" | ||
542 | fn f() fn f() | ||
543 | ma concat!(…) #[macro_export] | ||
544 | macro_rules! concat | ||
545 | md std | ||
546 | "##]], | ||
547 | ); | ||
548 | } | ||
549 | |||
550 | #[test] | ||
520 | fn completes_std_prelude_if_core_is_defined() { | 551 | fn completes_std_prelude_if_core_is_defined() { |
521 | check( | 552 | check( |
522 | r#" | 553 | r#" |