diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-03-07 16:47:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-03-07 16:47:10 +0800 |
commit | 1face5ab84618c03ad3077252ae289774ce7a816 (patch) | |
tree | e01a038c43f5f473a4bf657b538efedaaa980a01 /script/parser/luadoc.lua | |
parent | 2107c1c82bccaaf2e2cce937412ef8d5e8741b45 (diff) | |
download | lua-language-server-1face5ab84618c03ad3077252ae289774ce7a816.zip |
fix #975
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r-- | script/parser/luadoc.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index a47ebe34..d15fd95a 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -668,20 +668,21 @@ function parseType(parent) if currentRow < nextCommRow then return false end - if nextComm.text:sub(1, 2) == '-@' then + if nextComm.text:match '^%-%s*%@' then return false else - if nextComm.text:sub(1, 2) == '-|' then + local resumeHead = nextComm.text:match '^%-%s*%|' + if resumeHead then NextComment(i) row = row + i + 1 - local finishPos = nextComm.text:find('#', 3) or #nextComm.text - parseTokens(nextComm.text:sub(3, finishPos), nextComm.start + 3) + local finishPos = nextComm.text:find('#', #resumeHead + 1) or #nextComm.text + parseTokens(nextComm.text:sub(#resumeHead + 1, finishPos), nextComm.start + #resumeHead + 1) local resume = parseResume(result) if resume then if comments then resume.comment = table.concat(comments, '\n') else - resume.comment = nextComm.text:match('#%s*(.+)', 3) + resume.comment = nextComm.text:match('#%s*(.+)', #resumeHead + 1) end result.types[#result.types+1] = resume result.finish = resume.finish |