From dd5b3cd6f08ece075d1e3ad7c456b1eb7d289d88 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Jan 2021 14:33:02 +0300 Subject: Add a test for #7110 --- .../completion/src/completions/unqualified_path.rs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'crates/completion') 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 @@ -516,6 +516,37 @@ mod prelude { struct Option; } ); } + #[test] + fn completes_prelude_macros() { + check( + r#" +//- /main.rs crate:main deps:std +fn f() {$0} + +//- /std/lib.rs crate:std +#[prelude_import] +pub use prelude::*; + +#[macro_use] +mod prelude { + pub use crate::concat; +} + +mod macros { + #[rustc_builtin_macro] + #[macro_export] + macro_rules! concat { } +} +"#, + expect![[r##" + fn f() fn f() + ma concat!(…) #[macro_export] + macro_rules! concat + md std + "##]], + ); + } + #[test] fn completes_std_prelude_if_core_is_defined() { check( -- cgit v1.2.3