diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-11-24 10:06:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 10:06:21 +0800 |
commit | 8c4aca0fb664b7f7e383441e318b000e6cf971de (patch) | |
tree | 4aa2da1c1f69699040217cac8648bc0f8c5042e1 | |
parent | 50dfc81e075be5fe2cdf7b2b94007dd5ed2edefa (diff) | |
parent | 3511bfd1b986bfce7f9993ddf3e4a9e3818b83ec (diff) | |
download | lua-language-server-8c4aca0fb664b7f7e383441e318b000e6cf971de.zip |
Merge pull request #2424 from d-enk/fix-sign-resolve-nil-extends
fix: `doc.type.function` resolve only existing arg.extends
-rw-r--r-- | script/vm/sign.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/script/vm/sign.lua b/script/vm/sign.lua index 3cd6bc5d..38cb2242 100644 --- a/script/vm/sign.lua +++ b/script/vm/sign.lua @@ -142,13 +142,15 @@ function mt:resolve(uri, args) end if object.type == 'doc.type.function' then for i, arg in ipairs(object.args) do - for n in node:eachObject() do - if n.type == 'function' - or n.type == 'doc.type.function' then - ---@cast n parser.object - local farg = n.args and n.args[i] - if farg then - resolve(arg.extends, vm.compileNode(farg)) + if arg.extends then + for n in node:eachObject() do + if n.type == 'function' + or n.type == 'doc.type.function' then + ---@cast n parser.object + local farg = n.args and n.args[i] + if farg then + resolve(arg.extends, vm.compileNode(farg)) + end end end end |