diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-06-13 20:20:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-06-13 20:20:46 +0800 |
commit | fa287e75c9d4ad2ebabc1a6ceec5bbc9393a33b8 (patch) | |
tree | a22dbd9116007d08efa48f77cea147af1502fb9d /script/core | |
parent | 4081b303684b95ec27fd833a1cd10978d4ad5e10 (diff) | |
download | lua-language-server-fa287e75c9d4ad2ebabc1a6ceec5bbc9393a33b8.zip |
bind overloads
fix #2083
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/diagnostics/param-type-mismatch.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/script/core/diagnostics/param-type-mismatch.lua b/script/core/diagnostics/param-type-mismatch.lua index da39c5e1..acbf9c8c 100644 --- a/script/core/diagnostics/param-type-mismatch.lua +++ b/script/core/diagnostics/param-type-mismatch.lua @@ -32,26 +32,28 @@ end ---@param funcNode vm.node ---@param i integer +---@param uri uri ---@return vm.node? -local function getDefNode(funcNode, i) +local function getDefNode(funcNode, i, uri) local defNode = vm.createNode() - for f in funcNode:eachObject() do - if f.type == 'function' - or f.type == 'doc.type.function' then - local param = f.args and f.args[i] + for src in funcNode:eachObject() do + if src.type == 'function' + or src.type == 'doc.type.function' then + local param = src.args and src.args[i] if param then defNode:merge(vm.compileNode(param)) if param[1] == '...' then defNode:addOptional() end - - expandGenerics(defNode) end end end if defNode:isEmpty() then return nil end + + expandGenerics(defNode) + return defNode end @@ -91,7 +93,7 @@ return function (uri, callback) if not refNode then goto CONTINUE end - local defNode = getDefNode(funcNode, i) + local defNode = getDefNode(funcNode, i, uri) if not defNode then goto CONTINUE end |