diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-28 12:10:01 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-28 12:10:01 +0800 |
commit | d0ac1fdf3c0ee6b9b04ac69eaeb3c2336381ab14 (patch) | |
tree | 9a949da2ef88c8493e9e6bd606e5617e97715786 /script/parser/luadoc.lua | |
parent | bea414d6baff2666030577311a6b6130ec3d9861 (diff) | |
download | lua-language-server-d0ac1fdf3c0ee6b9b04ac69eaeb3c2336381ab14.zip |
stash
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r-- | script/parser/luadoc.lua | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 02b23d16..37447328 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1265,36 +1265,10 @@ local function bindDocsBetween(sources, binded, bindSources, start, finish) end end -local function bindParamAndReturnIndex(binded) - local func - for _, source in ipairs(binded[1].bindSources) do - if source.type == 'function' then - func = source - break - end - end - if not func then - return - end - 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 - func.docParamMap = paramMap - end +local function bindReturnIndex(binded) local returnIndex = 0 for _, doc in ipairs(binded) do - if doc.type == 'doc.param' then - if paramMap and doc.extends then - doc.extends.paramIndex = paramMap[doc.param[1]] - end - elseif doc.type == 'doc.return' then + if doc.type == 'doc.return' then for _, rtn in ipairs(doc.returns) do returnIndex = returnIndex + 1 rtn.returnIndex = returnIndex @@ -1340,7 +1314,7 @@ local function bindDoc(sources, binded) if #bindSources == 0 then bindDocsBetween(sources, binded, bindSources, guide.positionOf(row + 1, 0), guide.positionOf(row + 2, 0)) end - bindParamAndReturnIndex(binded) + bindReturnIndex(binded) bindClassAndFields(binded) end |