From a7a38de065f5ab570c805c367e0260849ee7ab3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 29 Sep 2021 14:44:37 +0800 Subject: resolve #587 --- test/completion/common.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/completion/common.lua') 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, + } +} -- cgit v1.2.3