summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-11 15:44:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-11 15:44:48 +0800
commit85a9019faccdf44fafec36fa816bbc4a78b58286 (patch)
tree409140cf0ee00b06da763c2c69f9349872fe626d /script/parser
parent72954de6b303866cbdbab25c0f4e8c00b9dfbe2b (diff)
downloadlua-language-server-85a9019faccdf44fafec36fa816bbc4a78b58286.zip
update semantic tokens
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua2
-rw-r--r--script/parser/luadoc.lua6
2 files changed, 5 insertions, 3 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 258d8cdc..1175fd84 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -141,7 +141,7 @@ local childMap = {
['doc.type.function'] = {'#args', '#returns', 'comment'},
['doc.type.ltable'] = {'#fields', 'comment'},
['doc.type.literal'] = {'node'},
- ['doc.type.arg'] = {'extends'},
+ ['doc.type.arg'] = {'name', 'extends'},
['doc.type.field'] = {'extends'},
['doc.overload'] = {'overload', 'comment'},
['doc.see'] = {'name', 'field'},
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 4d46d674..576cdb5c 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -368,8 +368,8 @@ local function parseTypeUnitFunction()
type = 'doc.type.arg',
parent = typeUnit,
}
- arg.name = parseName('doc.type.name', arg)
- or parseDots('doc.type.name', arg)
+ arg.name = parseName('doc.type.arg.name', arg)
+ or parseDots('doc.type.arg.name', arg)
if not arg.name then
pushWarning {
type = 'LUADOC_MISS_ARG_NAME',
@@ -484,6 +484,7 @@ local parseTypeUnit
local function parseDocFunction(parent, content)
if content == 'async' then
+ local pos = getStart()
local tp, cont = peekToken()
if tp == 'name' then
if cont == 'fun' then
@@ -491,6 +492,7 @@ local function parseDocFunction(parent, content)
local func = parseTypeUnit(parent, cont)
if func then
func.async = true
+ func.asyncPos = pos
return func
end
end