aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/tests
diff options
context:
space:
mode:
authoruHOOCCOOHu <[email protected]>2019-09-06 19:44:26 +0100
committeruHOOCCOOHu <[email protected]>2019-09-08 18:34:53 +0100
commit26b092bd3b431559d7aafbf42882f978c0bb3dab (patch)
tree194c41ab1320730d7f08823127404056e235cf2e /crates/ra_hir/src/nameres/tests
parente0f305a6bf710f64f789f909da93a8c362823b67 (diff)
Resolve textual scoped macros inside item
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r--crates/ra_hir/src/nameres/tests/macros.rs16
1 files changed, 15 insertions, 1 deletions
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() {
279} 279}
280 280
281#[test] 281#[test]
282fn plain_macros_are_textual_scoped_between_modules() { 282fn plain_macros_are_textual_scoped() {
283 let map = def_map( 283 let map = def_map(
284 r#" 284 r#"
285 //- /main.rs 285 //- /main.rs
@@ -310,6 +310,15 @@ fn plain_macros_are_textual_scoped_between_modules() {
310 } 310 }
311 foo!(ok_double_macro_use_shadow); 311 foo!(ok_double_macro_use_shadow);
312 312
313 baz!(NotFoundBefore);
314 #[macro_use]
315 mod m7 {
316 macro_rules! baz {
317 ($x:ident) => { struct $x; }
318 }
319 }
320 baz!(OkAfter);
321
313 //- /m1.rs 322 //- /m1.rs
314 foo!(NotFoundBeforeInside1); 323 foo!(NotFoundBeforeInside1);
315 macro_rules! bar { 324 macro_rules! bar {
@@ -337,14 +346,19 @@ fn plain_macros_are_textual_scoped_between_modules() {
337 assert_snapshot!(map, @r###" 346 assert_snapshot!(map, @r###"
338 ⋮crate 347 ⋮crate
339 ⋮Ok: t v 348 ⋮Ok: t v
349 ⋮OkAfter: t v
340 ⋮OkShadowStop: t v 350 ⋮OkShadowStop: t v
341 ⋮foo: m 351 ⋮foo: m
342 ⋮m1: t 352 ⋮m1: t
343 ⋮m2: t 353 ⋮m2: t
344 ⋮m3: t 354 ⋮m3: t
345 ⋮m5: t 355 ⋮m5: t
356 ⋮m7: t
346 ⋮ok_double_macro_use_shadow: v 357 ⋮ok_double_macro_use_shadow: v
347 358
359 ⋮crate::m7
360 ⋮baz: m
361
348 ⋮crate::m1 362 ⋮crate::m1
349 ⋮bar: m 363 ⋮bar: m
350 364