From 9f46e568af0a63e0db46596de3b32c779d27c5cd Mon Sep 17 00:00:00 2001 From: Crollie Rollz Date: Sun, 3 Apr 2022 02:10:57 +0800 Subject: fix(completion): call OOP emitter without colon syntax --- test/completion/common.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/completion') diff --git a/test/completion/common.lua b/test/completion/common.lua index 22d9f554..95903acb 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -2681,6 +2681,22 @@ emit:on('won', ) } } +TEST [[ +--- @class Emit +--- @field on fun(self: Emit, eventName: string, cb: function) +--- @field on fun(self: Emit, eventName: '"died"', cb: fun(i: integer)) +--- @field on fun(self: Emit, eventName: '"won"', cb: fun(s: string)) +local emit = {} + +emit.on(emit, 'won', ) +]] +{ + [1] = { + label = 'fun(s: string)', + kind = define.CompletionItemKind.Function, + } +} + TEST [[ local function f() local inferCache -- cgit v1.2.3