Skip to content

Commit f64feeb

Browse files
kartvaVeykril
andauthored
Correct node traversal to look at parent instead
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
1 parent 29951f9 commit f64feeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/ide/src/hover.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ pub(crate) fn hover(
176176
return None;
177177
}
178178

179-
let record_pat_field_list =
180-
token.parent_ancestors().find_map(ast::RecordPatFieldList::cast)?;
179+
let rest_pat = token.syntax().parent().and_then(ast::RestPat::cast)?;
180+
let record_pat_field_list = rest_pat.syntax().parent().and_then(ast::RecordPatFieldList::cast)?;
181181

182182
let record_pat =
183183
record_pat_field_list.syntax().parent().and_then(ast::RecordPat::cast)?;

0 commit comments

Comments
 (0)