summaryrefslogtreecommitdiff
path: root/script-beta/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-20 16:58:57 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-20 16:58:57 +0800
commit135f38d1b4f4d7b989f738bead5b59bdaf58f7e1 (patch)
tree0057af75111840f34da65a43cd8df8ce92f63f85 /script-beta/parser/luadoc.lua
parentbb319039fdf41326f23ef0c7288123889434b0a8 (diff)
downloadlua-language-server-135f38d1b4f4d7b989f738bead5b59bdaf58f7e1.zip
luadoc的第一步
Diffstat (limited to 'script-beta/parser/luadoc.lua')
-rw-r--r--script-beta/parser/luadoc.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/script-beta/parser/luadoc.lua b/script-beta/parser/luadoc.lua
index ebab1ee9..c84cf52b 100644
--- a/script-beta/parser/luadoc.lua
+++ b/script-beta/parser/luadoc.lua
@@ -671,7 +671,10 @@ return function (_, state)
table.sort(comments, function (a, b)
return a.start < b.start
end)
- ast.docs = {}
+ ast.docs = {
+ type = 'doc',
+ parent = ast,
+ }
pushError = state.pushError
@@ -679,6 +682,13 @@ return function (_, state)
local doc = buildLuaDoc(comment)
if doc then
ast.docs[#ast.docs+1] = doc
+ doc.parent = ast.docs
+ if ast.start > doc.start then
+ ast.start = doc.start
+ end
+ if ast.finish < doc.finish then
+ ast.finish = doc.finish
+ end
end
end
end