diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-22 01:49:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-22 01:49:34 +0800 |
commit | 2b499cb652e9ad6b60c85a491aebeb84f2f8941a (patch) | |
tree | 974649378f77c619aafc2f10cf78fdc9811c345e /script/core/diagnostics | |
parent | 7b3e7f4b0a62b7c9c3b895e89b4fe79bb8f350ba (diff) | |
download | lua-language-server-2b499cb652e9ad6b60c85a491aebeb84f2f8941a.zip |
improve one case
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r-- | script/core/diagnostics/redundant-parameter.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script/core/diagnostics/redundant-parameter.lua b/script/core/diagnostics/redundant-parameter.lua index 2b7f1230..deda918a 100644 --- a/script/core/diagnostics/redundant-parameter.lua +++ b/script/core/diagnostics/redundant-parameter.lua @@ -26,6 +26,12 @@ return function (uri, callback) end if funcArgs + 1 > #source.args then local lastArg = source.args[#source.args] + if lastArg.type == 'call' and funcArgs > 0 then + -- 如果函数接收至少一个参数,那么调用方最后一个参数是函数调用 + -- 导致的参数数量太多可以忽略。 + -- 如果函数不接收任何参数,那么任何参数都是错误的。 + return + end callback { start = lastArg.start, finish = lastArg.finish, |