From 93247b3a7d94df5ad1d824309b157cec8dc723e6 Mon Sep 17 00:00:00 2001 From: Lycs-D <139197676+Lycs-D@users.noreply.github.com> Date: Fri, 5 Jan 2024 07:39:45 +0800 Subject: [PATCH] [analyzer/psi/Signature.v] fix `parameters` --- analyzer/psi/Signature.v | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/analyzer/psi/Signature.v b/analyzer/psi/Signature.v index 58f55b58..70ba2b01 100644 --- a/analyzer/psi/Signature.v +++ b/analyzer/psi/Signature.v @@ -12,10 +12,12 @@ pub fn (s &Signature) get_type() types.Type { pub fn (n Signature) parameters() []PsiElement { mut parameters := []PsiElement{} - list := n.find_child_by_type_or_stub(.parameter_list) or { return parameters } - parameters << list.find_children_by_type_or_stub(.parameter_declaration) - list_type := n.find_child_by_type_or_stub(.type_parameter_list) or { return parameters } - parameters << list_type.find_children_by_type_or_stub(.type_parameter_declaration) + if list := n.find_child_by_type_or_stub(.parameter_list) { + parameters << list.find_children_by_type_or_stub(.parameter_declaration) + } + if list_type := n.find_child_by_type_or_stub(.type_parameter_list) { + parameters << list_type.find_children_by_type_or_stub(.type_parameter_declaration) + } return parameters }