diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/references.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 379674530..95ed8a045 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -1294,4 +1294,34 @@ pub use level1::Foo; | |||
1294 | "#]], | 1294 | "#]], |
1295 | ); | 1295 | ); |
1296 | } | 1296 | } |
1297 | |||
1298 | #[test] | ||
1299 | fn test_decl_macro_references() { | ||
1300 | check( | ||
1301 | r#" | ||
1302 | //- /lib.rs crate:lib | ||
1303 | #[macro_use] | ||
1304 | mod qux; | ||
1305 | mod bar; | ||
1306 | |||
1307 | pub use self::foo; | ||
1308 | //- /qux.rs | ||
1309 | #[macro_export] | ||
1310 | macro_rules! foo$0 { | ||
1311 | () => {struct Foo;}; | ||
1312 | } | ||
1313 | //- /bar.rs | ||
1314 | foo!(); | ||
1315 | //- /other.rs crate:other deps:lib new_source_root: | ||
1316 | lib::foo!(); | ||
1317 | "#, | ||
1318 | expect![[r#" | ||
1319 | foo Macro FileId(1) 0..61 29..32 | ||
1320 | |||
1321 | FileId(0) 46..49 | ||
1322 | FileId(2) 0..3 | ||
1323 | FileId(3) 5..8 | ||
1324 | "#]], | ||
1325 | ); | ||
1326 | } | ||
1297 | } | 1327 | } |