summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-28 12:10:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-28 12:10:01 +0800
commitd0ac1fdf3c0ee6b9b04ac69eaeb3c2336381ab14 (patch)
tree9a949da2ef88c8493e9e6bd606e5617e97715786 /script/parser/luadoc.lua
parentbea414d6baff2666030577311a6b6130ec3d9861 (diff)
downloadlua-language-server-d0ac1fdf3c0ee6b9b04ac69eaeb3c2336381ab14.zip
stash
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua32
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