diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-19 10:05:06 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-19 10:05:06 +0800 |
commit | 58e4cfe8c2498e676cf60b127f317033242bcd3a (patch) | |
tree | 18d07262d59bc6aca6c235b26ed045901b221779 /script-beta/core/diagnostics | |
parent | 3f10b39b568295a2f31f3b5bf7f84022dc763f60 (diff) | |
download | lua-language-server-58e4cfe8c2498e676cf60b127f317033242bcd3a.zip |
整理代码
Diffstat (limited to 'script-beta/core/diagnostics')
-rw-r--r-- | script-beta/core/diagnostics/redundant-parameter.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/script-beta/core/diagnostics/redundant-parameter.lua b/script-beta/core/diagnostics/redundant-parameter.lua index acb6f63c..ef0f172a 100644 --- a/script-beta/core/diagnostics/redundant-parameter.lua +++ b/script-beta/core/diagnostics/redundant-parameter.lua @@ -62,14 +62,10 @@ return function (uri, callback) local func = source.node local funcArgs - if not vm.hasType(func, 'function') then - return - end local defs = vm.getDefs(func) for _, def in ipairs(defs) do - local value = guide.getObjectValue(def) or def - if value.type == 'function' then - local args = countFuncArgs(value) + if def.type == 'function' then + local args = countFuncArgs(def) if not funcArgs or args > funcArgs then funcArgs = args end |