From c46be83a346eb2559420c2c880a52e7ce1787dde Mon Sep 17 00:00:00 2001 From: kjeremy Date: Thu, 31 Oct 2019 13:29:56 -0400 Subject: Fixes #2143 --- crates/ra_ide_api/src/goto_definition.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 1f3fa6c57..323faab33 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -315,6 +315,25 @@ mod tests { ); } + #[test] + fn goto_definition_works_for_macros_in_use_tree() { + check_goto( + " + //- /lib.rs + use foo::foo<|>; + + //- /foo/lib.rs + #[macro_export] + macro_rules! foo { + () => { + {} + }; + } + ", + "foo MACRO_CALL FileId(2) [0; 66) [29; 32)", + ); + } + #[test] fn goto_definition_works_for_methods() { covers!(goto_definition_works_for_methods); -- cgit v1.2.3