summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-08 17:38:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-08 17:38:44 +0800
commitdb4ae9c48b7d2f97823469e8a32aff170ecba12f (patch)
treed167f6430773ebd3fd93b31611b1ad98bec60aaa /script/parser/luadoc.lua
parent103aee69bf717936432e2739695305ce2058786e (diff)
downloadlua-language-server-db4ae9c48b7d2f97823469e8a32aff170ecba12f.zip
resolve #993 supports multi-types
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index d0c06ea6..1385d5ce 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -864,7 +864,6 @@ local docSwitch = util.switch()
if not first then
return nil
end
- first.docIndex = 1
local rests
while checkToken('symbol', ',', 1) do
nextToken()
@@ -873,7 +872,6 @@ local docSwitch = util.switch()
rests = {}
end
rests[#rests+1] = rest
- rest.docIndex = #rests + 1
end
return first, rests
end)
@@ -1601,7 +1599,6 @@ local function bindDoc(source, binded)
goto CONTINUE
end
if doc.type == 'doc.class'
- or doc.type == 'doc.type'
or doc.type == 'doc.deprecated'
or doc.type == 'doc.version'
or doc.type == 'doc.module' then
@@ -1609,6 +1606,13 @@ local function bindDoc(source, binded)
or isParam then
goto CONTINUE
end
+ elseif doc.type == 'doc.type' then
+ if source.type == 'function'
+ or isParam
+ or source._bindedDocType then
+ goto CONTINUE
+ end
+ source._bindedDocType = true
elseif doc.type == 'doc.overload' then
if not source.bindDocs then
source.bindDocs = {}