diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 35e39f9652..5548681f17 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -128,7 +128,7 @@ fn hover_text_from_name_kind(db: &RootDatabase, name_kind: NameKind) -> Option from_def_source(db, it), hir::ModuleDef::BuiltinType(it) => Some(it.to_string()), }, - Local(_) => None, + Local(it) => Some(rust_code_markup(it.ty(db).display_truncated(db, None).to_string())), TypeParam(_) | SelfType(_) => { // FIXME: Hover for generic param None @@ -174,6 +174,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Optionfoo; }; } &["fn foo()"], ); } + + #[test] + fn test_hover_through_expr_in_macro() { + check_hover_result( + " + //- /lib.rs + macro_rules! id { + ($($tt:tt)*) => { $($tt)* } + } + fn foo(bar:u32) { + let a = id!(ba<|>r); + } + ", + &["u32"], + ); + } }