summaryrefslogtreecommitdiff
path: root/test/completion/common.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-29 14:44:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-29 14:44:37 +0800
commita7a38de065f5ab570c805c367e0260849ee7ab3d (patch)
tree115b33af5b7f91c2d88be24eab99fdbf3f6f43d7 /test/completion/common.lua
parentb3df71ad1ae706a081411666e1a54973c2490db0 (diff)
downloadlua-language-server-a7a38de065f5ab570c805c367e0260849ee7ab3d.zip
resolve #587
Diffstat (limited to 'test/completion/common.lua')
-rw-r--r--test/completion/common.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index c5740e15..62569d01 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -2632,3 +2632,30 @@ class2:<??>
{
[1] = EXISTS,
}
+
+TEST [[
+--- @class Emit
+--- @field on fun(eventName: string, cb: function)
+--- @field on fun(eventName: '"died"', cb: fun(i: integer))
+--- @field on fun(eventName: '"won"', cb: fun(s: string))
+local emit = {}
+
+emit:on('<??>')
+]]
+(EXISTS)
+
+TEST [[
+--- @class Emit
+--- @field on fun(eventName: string, cb: function)
+--- @field on fun(eventName: '"died"', cb: fun(i: integer))
+--- @field on fun(eventName: '"won"', cb: fun(s: string))
+local emit = {}
+
+emit:on('won', <??>)
+]]
+{
+ [1] = {
+ label = 'fun(s: string)',
+ kind = define.CompletionItemKind.Function,
+ }
+}