summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-05-25 20:43:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-05-25 20:43:36 +0800
commitc41bb4d07d8ad4645ff26c54bb175233c8daea5d (patch)
treebf4974a1fa78a0bbbfd6a7c7ff49cfb4b4f24c63 /script/parser/luadoc.lua
parent2820e3e95faf76db959adabc5fe2042b5f098758 (diff)
downloadlua-language-server-c41bb4d07d8ad4645ff26c54bb175233c8daea5d.zip
update
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 2d21c9ac..054ea3f1 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -194,6 +194,7 @@ local function parseClass(parent)
local result = {
type = 'doc.class',
parent = parent,
+ fields = {},
}
result.class = parseName('doc.class.name', result)
if not result.class then
@@ -1170,6 +1171,18 @@ local function bindParamAndReturnIndex(binded)
end
end
+local function bindClassAndFields(binded)
+ local class
+ for _, doc in ipairs(binded) do
+ if doc.type == 'doc.class' then
+ class = doc
+ elseif doc.type == 'doc.field' then
+ class.fields[#class.fields+1] = doc
+ doc.class = class
+ end
+ end
+end
+
local function bindDoc(sources, lns, binded)
if not binded then
return
@@ -1192,6 +1205,7 @@ local function bindDoc(sources, lns, binded)
bindDocsBetween(sources, binded, bindSources, nstart, nfinish)
end
bindParamAndReturnIndex(binded)
+ bindClassAndFields(binded)
end
local function bindDocs(state)