From a04177f135be89ddbf1788c6f747c26812e90438 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 Dec 2019 11:19:09 +0100 Subject: Add local functions to bodies --- crates/ra_ide/src/goto_definition.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index 184555792..ee4ae3e03 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs @@ -858,4 +858,21 @@ mod tests { "y", ); } + + #[test] + fn goto_def_in_local_fn() { + check_goto( + " + //- /lib.rs + fn main() { + fn foo() { + let x = 92; + <|>x; + } + } + ", + "x BIND_PAT FileId(1) [39; 40)", + "x", + ); + } } -- cgit v1.2.3