mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +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
|
||||
.parent_ancestors()
|
||||
.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! {
|
||||
match node {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue