From 26b092bd3b431559d7aafbf42882f978c0bb3dab Mon Sep 17 00:00:00 2001 From: uHOOCCOOHu Date: Sat, 7 Sep 2019 02:44:26 +0800 Subject: Resolve textual scoped macros inside item --- crates/ra_hir/src/nameres/tests/macros.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/nameres/tests') diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs index 8f0db95f2..a894c6836 100644 --- a/crates/ra_hir/src/nameres/tests/macros.rs +++ b/crates/ra_hir/src/nameres/tests/macros.rs @@ -279,7 +279,7 @@ fn prelude_cycle() { } #[test] -fn plain_macros_are_textual_scoped_between_modules() { +fn plain_macros_are_textual_scoped() { let map = def_map( r#" //- /main.rs @@ -310,6 +310,15 @@ fn plain_macros_are_textual_scoped_between_modules() { } foo!(ok_double_macro_use_shadow); + baz!(NotFoundBefore); + #[macro_use] + mod m7 { + macro_rules! baz { + ($x:ident) => { struct $x; } + } + } + baz!(OkAfter); + //- /m1.rs foo!(NotFoundBeforeInside1); macro_rules! bar { @@ -337,14 +346,19 @@ fn plain_macros_are_textual_scoped_between_modules() { assert_snapshot!(map, @r###" ⋮crate ⋮Ok: t v + ⋮OkAfter: t v ⋮OkShadowStop: t v ⋮foo: m ⋮m1: t ⋮m2: t ⋮m3: t ⋮m5: t + ⋮m7: t ⋮ok_double_macro_use_shadow: v ⋮ + ⋮crate::m7 + ⋮baz: m + ⋮ ⋮crate::m1 ⋮bar: m ⋮ -- cgit v1.2.3