mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-16 23:24:03 +00:00
Correct node traversal to look at parent instead
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
29951f9766
commit
f64feeb11a
1 changed files with 2 additions and 2 deletions
|
@ -176,8 +176,8 @@ pub(crate) fn hover(
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let record_pat_field_list =
|
let rest_pat = token.syntax().parent().and_then(ast::RestPat::cast)?;
|
||||||
token.parent_ancestors().find_map(ast::RecordPatFieldList::cast)?;
|
let record_pat_field_list = rest_pat.syntax().parent().and_then(ast::RecordPatFieldList::cast)?;
|
||||||
|
|
||||||
let record_pat =
|
let record_pat =
|
||||||
record_pat_field_list.syntax().parent().and_then(ast::RecordPat::cast)?;
|
record_pat_field_list.syntax().parent().and_then(ast::RecordPat::cast)?;
|
||||||
|
|
Loading…
Reference in a new issue