diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-06-26 18:04:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-06-26 18:04:28 +0800 |
commit | 145464910a730f8583ff5352ff92026d4c34d370 (patch) | |
tree | 4c7ceb4f101b52fa70fd74e877b8b1f22c84b923 /script/core | |
parent | 5abdc683b2577131d96db210987e37e4e99203fc (diff) | |
download | lua-language-server-145464910a730f8583ff5352ff92026d4c34d370.zip |
check nil
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/diagnostics/helper/missing-doc-helper.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/script/core/diagnostics/helper/missing-doc-helper.lua b/script/core/diagnostics/helper/missing-doc-helper.lua index 84221693..3b953b86 100644 --- a/script/core/diagnostics/helper/missing-doc-helper.lua +++ b/script/core/diagnostics/helper/missing-doc-helper.lua @@ -38,8 +38,9 @@ end local function checkFunction(source, callback, commentId, paramId, returnId) local functionName = source.parent[1] + local argCount = source.args and #source.args or 0 - if #source.args == 0 and not source.returns and not source.bindDocs then + if argCount == 0 and not source.returns and not source.bindDocs then callback { start = source.start, finish = source.finish, @@ -47,7 +48,7 @@ local function checkFunction(source, callback, commentId, paramId, returnId) } end - if #source.args > 0 then + if argCount > 0 then for _, arg in ipairs(source.args) do local argName = arg[1] if argName ~= 'self' then |