summaryrefslogtreecommitdiff
path: root/script-beta/core/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-23 15:48:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-23 15:48:48 +0800
commit7ed999a6af7ca021d577a1853efb1d11916d34f9 (patch)
treed94b890590216c0ad2dc878eb2c91985cd909586 /script-beta/core/diagnostics
parentbb337bbf6c62076de5425966ea41b3cbed6bb987 (diff)
downloadlua-language-server-7ed999a6af7ca021d577a1853efb1d11916d34f9.zip
修正计算函数接收参数数量的bug
Diffstat (limited to 'script-beta/core/diagnostics')
-rw-r--r--script-beta/core/diagnostics/redundant-parameter.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/script-beta/core/diagnostics/redundant-parameter.lua b/script-beta/core/diagnostics/redundant-parameter.lua
index b6225678..a03a408f 100644
--- a/script-beta/core/diagnostics/redundant-parameter.lua
+++ b/script-beta/core/diagnostics/redundant-parameter.lua
@@ -36,15 +36,15 @@ end
local function countFuncArgs(source)
local result = 0
+ if source.parent and source.parent.type == 'setmethod' then
+ result = result + 1
+ end
if not source.args then
return result
end
if source.args[#source.args].type == '...' then
return math.maxinteger
end
- if source.parent and source.parent.type == 'setmethod' then
- result = result + 1
- end
result = result + #source.args
return result
end