From ffdc740446585502bd179cb608a033dd74a41e39 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Wed, 26 Feb 2020 12:27:57 +0800 Subject: Add recursive support in original_range --- crates/ra_ide/src/hover.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index ace33c079..29b16e602 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -753,6 +753,27 @@ fn func(foo: i32) { if true { <|>foo; }; } assert_eq!(hover_on, "bar") } + #[test] + fn test_hover_through_expr_in_macro_recursive() { + let hover_on = check_hover_result( + " + //- /lib.rs + macro_rules! id_deep { + ($($tt:tt)*) => { $($tt)* } + } + macro_rules! id { + ($($tt:tt)*) => { id_deep!($($tt)*) } + } + fn foo(bar:u32) { + let a = id!(ba<|>r); + } + ", + &["u32"], + ); + + assert_eq!(hover_on, "bar") + } + #[test] fn test_hover_non_ascii_space_doc() { check_hover_result( -- cgit v1.2.3