Improve goto definition for MBE

This commit is contained in:
Edwin Cheng 2019-06-01 19:34:19 +08:00
parent 6c1ec865fb
commit 371961be0e
6 changed files with 55 additions and 9 deletions

View file

@ -216,6 +216,29 @@ mod tests {
);
}
#[test]
fn goto_definition_works_for_macros_from_other_crates() {
covers!(goto_definition_works_for_macros);
check_goto(
"
//- /lib.rs
use foo::foo;
fn bar() {
<|>foo!();
}
//- /foo/lib.rs
#[macro_export]
macro_rules! foo {
() => {
{}
};
}
",
"foo MACRO_CALL FileId(2) [0; 79) [29; 32)",
);
}
#[test]
fn goto_definition_works_for_methods() {
covers!(goto_definition_works_for_methods);