summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
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/core/diagnostics
parent5b950742705515c4bc2502e8a902221f44bf644f (diff)
downloadlua-language-server-08638eedb6cf74bd815e933f4a90e989a1516948.zip
some fix
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r--script/core/diagnostics/param-type-mismatch.lua3
-rw-r--r--script/core/diagnostics/unused-vararg.lua3
2 files changed, 6 insertions, 0 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