aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-23 12:05:45 +0000
committerGitHub <[email protected]>2021-03-23 12:05:45 +0000
commit258afb8fb8331e43a75e4f19df255d85d2430be7 (patch)
tree41bafbd0806672f10882aa02d4558e44137beea7 /crates/ide
parent1efd220f2f844596dd22bfd73a8a0c596354be38 (diff)
parent395183e0b7609dfb0d21f135879dc8f3d8e97e41 (diff)
Merge #8138
8138: Set up a search scope when searching for mbe macro references r=Veykril a=Veykril Closes #6184 Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/references.rs30
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]
1304mod qux;
1305mod bar;
1306
1307pub use self::foo;
1308//- /qux.rs
1309#[macro_export]
1310macro_rules! foo$0 {
1311 () => {struct Foo;};
1312}
1313//- /bar.rs
1314foo!();
1315//- /other.rs crate:other deps:lib new_source_root:
1316lib::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}