Set up a search scope when searching for mbe macro references

This commit is contained in:
Lukas Wirth 2021-03-21 20:08:08 +01:00
parent 1efd220f2f
commit bad4e48672
3 changed files with 56 additions and 4 deletions

View file

@ -1294,4 +1294,34 @@ pub use level1::Foo;
"#]],
);
}
#[test]
fn test_decl_macro_references() {
check(
r#"
//- /lib.rs crate:lib
#[macro_use]
mod qux;
mod bar;
pub use self::foo;
//- /qux.rs
#[macro_export]
macro_rules! foo$0 {
() => {struct Foo;};
}
//- /bar.rs
foo!();
//- /other.rs crate:other deps:lib new_source_root:
lib::foo!();
"#,
expect![[r#"
foo Macro FileId(1) 0..61 29..32
FileId(0) 46..49
FileId(2) 0..3
FileId(3) 5..8
"#]],
);
}
}