From 63b1394b7011b0cd34a41d2deda3e24876b1e6ae Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 24 Jun 2021 21:37:07 +0200 Subject: [PATCH] Complete `macro_use` attribute on modules --- .../src/completions/attribute.rs | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs index cc4f4b2af728..9ee7f2bce6be 100644 --- a/crates/ide_completion/src/completions/attribute.rs +++ b/crates/ide_completion/src/completions/attribute.rs @@ -177,7 +177,7 @@ static KIND_TO_ATTRIBUTES: Lazy> = Lazy::new(|| { "recursion_limit", "type_length_limit", "windows_subsystem" ), ), - (MODULE, attrs!(item, "no_implicit_prelude", "path")), + (MODULE, attrs!(item, "macro_use", "no_implicit_prelude", "path")), (ITEM_LIST, attrs!(item, "no_implicit_prelude")), (MACRO_RULES, attrs!(item, "macro_export", "macro_use")), (MACRO_DEF, attrs!(item)), @@ -405,20 +405,21 @@ mod tests { check( r#"#[$0] mod foo;"#, expect![[r#" - at allow(…) - at cfg(…) - at cfg_attr(…) - at deny(…) - at forbid(…) - at warn(…) - at deprecated - at doc = "…" - at doc(hidden) - at doc(alias = "…") - at must_use - at no_mangle - at path = "…" - "#]], + at allow(…) + at cfg(…) + at cfg_attr(…) + at deny(…) + at forbid(…) + at warn(…) + at deprecated + at doc = "…" + at doc(hidden) + at doc(alias = "…") + at must_use + at no_mangle + at macro_use + at path = "…" + "#]], ); check( r#"mod foo {#![$0]}"#,