mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
on hover fallback error, adds ast::type as possible node
This commit is contained in:
parent
4904b2bdf8
commit
49dac4070c
1 changed files with 5 additions and 1 deletions
|
@ -235,7 +235,11 @@ fn hover_type_fallback(
|
||||||
let node = token
|
let node = token
|
||||||
.parent_ancestors()
|
.parent_ancestors()
|
||||||
.take_while(|it| !ast::Item::can_cast(it.kind()))
|
.take_while(|it| !ast::Item::can_cast(it.kind()))
|
||||||
.find(|n| ast::Expr::can_cast(n.kind()) || ast::Pat::can_cast(n.kind()))?;
|
.find(|n| {
|
||||||
|
ast::Expr::can_cast(n.kind())
|
||||||
|
|| ast::Pat::can_cast(n.kind())
|
||||||
|
|| ast::Type::can_cast(n.kind())
|
||||||
|
})?;
|
||||||
|
|
||||||
let expr_or_pat = match_ast! {
|
let expr_or_pat = match_ast! {
|
||||||
match node {
|
match node {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue