summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-28 20:30:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-28 20:30:27 +0800
commit08638eedb6cf74bd815e933f4a90e989a1516948 (patch)
treeea88bcb7e13cef38075cba431bbc872cb8e03d7d /script
parent5b950742705515c4bc2502e8a902221f44bf644f (diff)
downloadlua-language-server-08638eedb6cf74bd815e933f4a90e989a1516948.zip
some fix
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/param-type-mismatch.lua3
-rw-r--r--script/core/diagnostics/unused-vararg.lua3
-rw-r--r--script/vm/runner.lua2
3 files changed, 7 insertions, 1 deletions
diff --git a/script/core/diagnostics/param-type-mismatch.lua b/script/core/diagnostics/param-type-mismatch.lua
index a4390b50..6f34f579 100644
--- a/script/core/diagnostics/param-type-mismatch.lua
+++ b/script/core/diagnostics/param-type-mismatch.lua
@@ -22,6 +22,9 @@ return function (uri, callback)
local param = f.args and f.args[i]
if param then
defNode:merge(vm.compileNode(param))
+ if param[1] == '...' then
+ defNode:addOptional()
+ end
end
end
end
diff --git a/script/core/diagnostics/unused-vararg.lua b/script/core/diagnostics/unused-vararg.lua
index ce033cf3..08f12c4d 100644
--- a/script/core/diagnostics/unused-vararg.lua
+++ b/script/core/diagnostics/unused-vararg.lua
@@ -15,6 +15,9 @@ return function (uri, callback)
end
guide.eachSourceType(ast.ast, 'function', function (source)
+ if #source == 0 then
+ return
+ end
local args = source.args
if not args then
return
diff --git a/script/vm/runner.lua b/script/vm/runner.lua
index 8c1e816e..fcd0f681 100644
--- a/script/vm/runner.lua
+++ b/script/vm/runner.lua
@@ -209,7 +209,7 @@ function mt:_lookInto(action, topNode, outNode)
local topNode1, outNode1 = self:_lookInto(action[1], topNode, outNode)
local topNode2, outNode2 = self:_lookInto(action[2], outNode1, outNode1:copy())
topNode = vm.createNode(topNode1, topNode2)
- outNode = outNode2
+ outNode = outNode2:copy()
elseif action.op.type == '=='
or action.op.type == '~=' then
local exp, checker