From fe78a14bbb9769c8ccd5cc41415702f5176a8e88 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 14 Mar 2020 14:25:30 +0800 Subject: Support local macro_rules --- crates/ra_ide/src/goto_definition.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates/ra_ide/src/goto_definition.rs') diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index a55a13ffc..a7be92ce3 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs @@ -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); -- cgit v1.2.3