summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-09 20:00:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-09 20:00:05 +0800
commitd99c23af4bf8be944f58b374141dbfb81d48b5f5 (patch)
tree185e92fac5c0e28a80e772a9fdad5b0a6a4bbfd8 /test/completion
parentbc92c4dcefc0c87420c7d4b239c1eb4b9d14588c (diff)
downloadlua-language-server-d99c23af4bf8be944f58b374141dbfb81d48b5f5.zip
#1061 completion for `doc.type.code`
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 613f9b0c..1cdff803 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3348,3 +3348,37 @@ local xyz
kind = define.CompletionItemKind.Variable,
}
}
+
+TEST [[
+---@type `CONST.X` | `CONST.Y`
+local x
+
+if x == <??>
+]]
+{
+ {
+ label = 'CONST.X',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = 'CONST.Y',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
+---@param x `CONST.X` | `CONST.Y`
+local function f(x) end
+
+f(<??>)
+]]
+{
+ {
+ label = 'CONST.X',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = 'CONST.Y',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}