summaryrefslogtreecommitdiff
path: root/server/src/core/vm.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-02-14 15:08:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-02-14 15:08:39 +0800
commitcaec2f97984f72d0ecb5f0c35174c682e749ac8a (patch)
tree1a24e8f6d61011773cf661cc49413991ee8b22de /server/src/core/vm.lua
parenta8a3b6fd320b226d1b1779a337dd69502da1f666 (diff)
downloadlua-language-server-caec2f97984f72d0ecb5f0c35174c682e749ac8a.zip
库函数支持检查参数数量
Diffstat (limited to 'server/src/core/vm.lua')
-rw-r--r--server/src/core/vm.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index 79381876..812c3945 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -836,9 +836,13 @@ function mt:getLibValue(lib, parentType, v)
value.maxReturns = 0
end
if lib.args then
+ value.args = lib.args
local values = {}
for i, arg in ipairs(lib.args) do
values[i] = self:getLibValue(arg, parentType) or self:createValue('any')
+ if arg.type == '...' then
+ value.hasDots = true
+ end
end
self:setFunctionArg(value, values)
end