summaryrefslogtreecommitdiff
path: root/test
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 /test
parent125d943a7faec97b7169d0088a12ba6a44a14c16 (diff)
downloadlua-language-server-afc5f4e128f17b70dd6f661394da1acfd924be14.zip
add completion and semantic for `@cast`
Diffstat (limited to 'test')
-rw-r--r--test/completion/common.lua24
-rw-r--r--test/definition/luadoc.lua6
2 files changed, 30 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 1fc37bb5..613f9b0c 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3324,3 +3324,27 @@ x.y.<??>
kind = define.CompletionItemKind.Field,
}
}
+
+TEST [[
+local xyz
+
+---@cast <??>
+]]
+{
+ {
+ label = 'xyz',
+ kind = define.CompletionItemKind.Variable,
+ },
+}
+
+TEST [[
+local xyz
+
+---@cast x<??>
+]]
+{
+ {
+ label = 'xyz',
+ kind = define.CompletionItemKind.Variable,
+ }
+}
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 19b4421b..47859b15 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -893,3 +893,9 @@ TEST [[
---@type XXX<<?YYY?>>
]]
+
+TEST [[
+local <!x!>
+
+---@cast <?x?> integer
+]]