fix: wrong order of def-and-use names (#281)

This commit is contained in:
Myriad-Dreamin 2024-05-13 21:30:13 +08:00 committed by GitHub
parent 66e6aff2b4
commit c90a766fdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -497,12 +497,12 @@ impl LexicalHierarchyWorker {
self.get_symbols_in_first_expr(node.children(), None)?;
}
SyntaxKind::Named => {
self.get_symbols_in_first_expr(node.children().rev(), None)?;
if self.ident_context == IdentContext::Params {
let ident = node.children().find(|n| n.kind() == SyntaxKind::Ident);
self.get_symbols_in_opt_with(ident, IdentContext::Var)?;
}
self.get_symbols_in_first_expr(node.children().rev(), None)?;
}
k if k.is_trivia() || k.is_keyword() || k.is_error() => {}
_ => {