summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-25 01:56:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-25 01:56:00 +0800
commitafc5f4e128f17b70dd6f661394da1acfd924be14 (patch)
tree2823ab03cce20bcf0ed4a9d1c1f583636cdf0313 /script/parser/luadoc.lua
parent125d943a7faec97b7169d0088a12ba6a44a14c16 (diff)
downloadlua-language-server-afc5f4e128f17b70dd6f661394da1acfd924be14.zip
add completion and semantic for `@cast`
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index e10ef356..89a5ee9b 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -1235,7 +1235,6 @@ local docSwitch = util.switch()
start = getFinish(),
finish = getFinish(),
}
- result.casts[#result.casts+1] = block
if checkToken('symbol', '+', 1) then
block.mode = '+'
nextToken()
@@ -1261,6 +1260,10 @@ local docSwitch = util.switch()
end
end
+ if block.optional or block.extends then
+ result.casts[#result.casts+1] = block
+ end
+
if checkToken('symbol', ',', 1) then
nextToken()
else