diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-21 21:11:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-21 21:11:54 +0800 |
commit | 1dcd60d2dc139cf4c5a07e3cae440807c254d897 (patch) | |
tree | 88b2be84b26076390f045b8ebb277f69e9747ea3 /script/parser | |
parent | d4b7f8e774ffea6abc5050fd61c2d1b5a033437c (diff) | |
download | lua-language-server-1dcd60d2dc139cf4c5a07e3cae440807c254d897.zip |
cleanup
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/luadoc.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 423fa52d..57f3b42a 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1144,21 +1144,21 @@ local function bindParamAndReturnIndex(binded) if not func then return end - if not func.args then - return - end - local paramIndex = 0 - local paramMap = {} - for _, param in ipairs(func.args) do - paramIndex = paramIndex + 1 - if param[1] then - paramMap[param[1]] = paramIndex + local paramMap + if func.args then + local paramIndex = 0 + paramMap = {} + for _, param in ipairs(func.args) do + paramIndex = paramIndex + 1 + if param[1] then + paramMap[param[1]] = paramIndex + end end end local returnIndex = 0 for _, doc in ipairs(binded) do if doc.type == 'doc.param' then - if doc.extends then + if paramMap and doc.extends then doc.extends.paramIndex = paramMap[doc.param[1]] end elseif doc.type == 'doc.return' then |