diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-23 15:48:48 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-23 15:48:48 +0800 |
commit | 7ed999a6af7ca021d577a1853efb1d11916d34f9 (patch) | |
tree | d94b890590216c0ad2dc878eb2c91985cd909586 /script-beta/core/diagnostics | |
parent | bb337bbf6c62076de5425966ea41b3cbed6bb987 (diff) | |
download | lua-language-server-7ed999a6af7ca021d577a1853efb1d11916d34f9.zip |
修正计算函数接收参数数量的bug
Diffstat (limited to 'script-beta/core/diagnostics')
-rw-r--r-- | script-beta/core/diagnostics/redundant-parameter.lua | 6 |
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 |