Support local macro_rules

This commit is contained in:
Edwin Cheng 2020-03-14 14:25:30 +08:00
parent 4c85e53531
commit fe78a14bbb
6 changed files with 96 additions and 16 deletions

View file

@ -787,6 +787,21 @@ mod tests {
);
}
#[test]
fn goto_def_in_local_macro() {
check_goto(
"
//- /lib.rs
fn bar() {
macro_rules! foo { () => { () } }
<|>foo!();
}
",
"foo MACRO_CALL FileId(1) [15; 48) [28; 31)",
"macro_rules! foo { () => { () } }|foo",
);
}
#[test]
fn goto_def_for_field_init_shorthand() {
covers!(ra_ide_db::goto_def_for_field_init_shorthand);