summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-10 11:08:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-10 11:08:58 +0800
commit6c6ac3ba0f454b64bb74cebd11252cac828ff854 (patch)
treef1258ab3cdf7ec1f2c6032da18989afc714d6148 /script-beta/core
parentcc5e87de72ce1ab76c60149da7aa5d65dc807342 (diff)
downloadlua-language-server-6c6ac3ba0f454b64bb74cebd11252cac828ff854.zip
修正诊断多余参数的一个bug
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/diagnostics/redundant-parameter.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/script-beta/core/diagnostics/redundant-parameter.lua b/script-beta/core/diagnostics/redundant-parameter.lua
index ec14188e..839dd182 100644
--- a/script-beta/core/diagnostics/redundant-parameter.lua
+++ b/script-beta/core/diagnostics/redundant-parameter.lua
@@ -67,13 +67,12 @@ return function (uri, callback)
local func = source.node
local funcArgs
vm.eachDef(func, function (info)
- if info.mode == 'value' then
- local src = info.source
- if src.type == 'function' then
- local args = countFuncArgs(src)
- if not funcArgs or args > funcArgs then
- funcArgs = args
- end
+ local src = info.source
+ local f = src.value
+ if f and f.type == 'function' then
+ local args = countFuncArgs(f)
+ if not funcArgs or args > funcArgs then
+ funcArgs = args
end
end
end)