From 7a5ff0f37c5fb7d1d21ee56da0168f68e54fbca5 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Fri, 28 Feb 2020 22:53:59 +0800 Subject: Simpilfy origin_range logic --- crates/ra_ide/src/hover.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 7ba4bfcac..cc79f1fab 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -738,6 +738,30 @@ fn func(foo: i32) { if true { <|>foo; }; } assert_eq!(hover_on, "bar") } + #[test] + fn test_hover_through_func_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 bar() -> u32 { + 0 + } + fn foo() { + let a = id!([0u32, bar(<|>)] ); + } + ", + &["u32"], + ); + + assert_eq!(hover_on, "bar()") + } + #[test] fn test_hover_through_literal_string_in_macro() { let hover_on = check_hover_result( -- cgit v1.2.3