diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-27 20:50:59 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-27 20:50:59 +0800 |
commit | badf7b9db225c4277cc94e6735c2dade29624f52 (patch) | |
tree | bcc90b207b7628233ec84407dca4e706824176a1 /script/parser/luadoc.lua | |
parent | b19c7cefcaeac4537054be2dab6f7cf4b3d7ed26 (diff) | |
download | lua-language-server-badf7b9db225c4277cc94e6735c2dade29624f52.zip |
add support for `---@public`
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r-- | script/parser/luadoc.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index bd631318..8a671dbc 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -991,7 +991,8 @@ local docSwitch = util.switch() if tp == 'name' then if value == 'public' or value == 'protected' - or value == 'private' then + or value == 'private' + or value == 'public' then result.visible = value result.start = getStart() return true @@ -1461,6 +1462,14 @@ local docSwitch = util.switch() finish = getFinish(), } end) + : case 'public' + : call(function () + return { + type = 'doc.public', + start = getFinish(), + finish = getFinish(), + } + end) local function convertTokens(doc) local tp, text = nextToken() @@ -1678,7 +1687,8 @@ local function bindDoc(source, binded) or doc.type == 'doc.module' or doc.type == 'doc.source' or doc.type == 'doc.private' - or doc.type == 'doc.protected' then + or doc.type == 'doc.protected' + or doc.type == 'doc.public' then if source.type == 'function' or isParam then goto CONTINUE |