summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-05-11 18:33:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-05-11 18:33:06 +0800
commit114cb74417f614fcdf46c7048b626a5f9a95126a (patch)
treef4f834ec360e95fdb70fbfd132e4af7ba4f13871 /script
parent61f48f477482aac49a963e40aeea8042179bdc28 (diff)
downloadlua-language-server-114cb74417f614fcdf46c7048b626a5f9a95126a.zip
整理代码
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/duplicate-doc-field.lua2
-rw-r--r--script/core/signature.lua5
-rw-r--r--script/vm/compiler.lua2
3 files changed, 3 insertions, 6 deletions
diff --git a/script/core/diagnostics/duplicate-doc-field.lua b/script/core/diagnostics/duplicate-doc-field.lua
index 098b41a4..6066ae53 100644
--- a/script/core/diagnostics/duplicate-doc-field.lua
+++ b/script/core/diagnostics/duplicate-doc-field.lua
@@ -15,7 +15,7 @@ local function getFieldEventName(doc)
if docFunc.type ~= 'doc.type.function' then
return nil
end
- for i = 1, 2 do
+ for i = 1, #docFunc.args do
local arg = docFunc.args[i]
if arg
and arg.extends
diff --git a/script/core/signature.lua b/script/core/signature.lua
index 98018b21..c52dcff3 100644
--- a/script/core/signature.lua
+++ b/script/core/signature.lua
@@ -94,10 +94,7 @@ local function isEventNotMatch(call, src)
return false
end
local literal, index
- for i = 1, 2 do
- if not call.args[i] then
- break
- end
+ for i = 1, #call.args do
literal = guide.getLiteral(call.args[i])
if literal then
index = i
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 78b62b27..e1b1b43b 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -873,7 +873,7 @@ local function compileCallArgNode(arg, call, callNode, fixIndex, myIndex)
---@type integer?, table<any, boolean>?
local eventIndex, eventMap
if call.args then
- for i = 1, 2 do
+ for i = 1, 10 do
local eventArg = call.args[i + fixIndex]
if not eventArg then
break