Skip to content

Commit 49dac40

Browse files
committed
on hover fallback error, adds ast::type as possible node
1 parent 4904b2b commit 49dac40

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/ide/src/hover.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ fn hover_type_fallback(
235235
let node = token
236236
.parent_ancestors()
237237
.take_while(|it| !ast::Item::can_cast(it.kind()))
238-
.find(|n| ast::Expr::can_cast(n.kind()) || ast::Pat::can_cast(n.kind()))?;
238+
.find(|n| {
239+
ast::Expr::can_cast(n.kind())
240+
|| ast::Pat::can_cast(n.kind())
241+
|| ast::Type::can_cast(n.kind())
242+
})?;
239243

240244
let expr_or_pat = match_ast! {
241245
match node {

0 commit comments

Comments
 (0)