summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-22 01:49:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-22 01:49:34 +0800
commit2b499cb652e9ad6b60c85a491aebeb84f2f8941a (patch)
tree974649378f77c619aafc2f10cf78fdc9811c345e /script/core/diagnostics
parent7b3e7f4b0a62b7c9c3b895e89b4fe79bb8f350ba (diff)
downloadlua-language-server-2b499cb652e9ad6b60c85a491aebeb84f2f8941a.zip
improve one case
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r--script/core/diagnostics/redundant-parameter.lua6
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,