diff options
Diffstat (limited to 'script/core/diagnostics/redundant-parameter.lua')
-rw-r--r-- | script/core/diagnostics/redundant-parameter.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/script/core/diagnostics/redundant-parameter.lua b/script/core/diagnostics/redundant-parameter.lua index 9898d9bd..667f9c61 100644 --- a/script/core/diagnostics/redundant-parameter.lua +++ b/script/core/diagnostics/redundant-parameter.lua @@ -52,4 +52,22 @@ return function (uri, callback) end end end) + + ---@async + guide.eachSourceType(state.ast, 'function', function (source) + await.delay() + if not source.args then + return + end + local _, funcArgs = vm.countParamsOfSource(source) + local myArgs = #source.args + for i = funcArgs + 1, myArgs do + local arg = source.args[i] + callback { + start = arg.start, + finish = arg.finish, + message = lang.script('DIAG_OVER_MAX_ARGS', funcArgs, myArgs), + } + end + end) end |