mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
Auto merge of #12939 - jean-santos:errors-ide-hover-wrong-place, r=Veykril
Error Diagnostics appear in the wrong place Fix #12436
This commit is contained in:
commit
c6a9fbfd00
@ -232,10 +232,12 @@ fn hover_type_fallback(
|
||||
token: &SyntaxToken,
|
||||
original_token: &SyntaxToken,
|
||||
) -> Option<RangeInfo<HoverResult>> {
|
||||
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()))?;
|
||||
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())
|
||||
|| ast::Type::can_cast(n.kind())
|
||||
})?;
|
||||
|
||||
let expr_or_pat = match_ast! {
|
||||
match node {
|
||||
|
Loading…
Reference in New Issue
Block a user