From 553254973e24a2c0bdf1475fccbbc4603e8421f0 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 27 Feb 2020 00:12:26 +0800 Subject: Skip trival token in original_range --- crates/ra_ide/src/hover.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'crates/ra_ide/src/hover.rs') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 29b16e602..177038e20 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -174,6 +174,10 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Optionfoo; }; } assert_eq!(hover_on, "bar") } + #[test] + fn test_hover_through_literal_string_in_macro() { + // FIXME: Currently `hover::type_of` do not work inside + // macro expansion + check_hover_no_result( + r#" + //- /lib.rs + macro_rules! arr { + ($($tt:tt)*) => { [$($tt)*)] } + } + fn foo() { + let mastered_for_itunes = ""; + let _ = arr!("Tr<|>acks", &mastered_for_itunes); + } + "#, + ); + } + #[test] fn test_hover_non_ascii_space_doc() { check_hover_result( -- cgit v1.2.3