From e32f17eb3cb4b98960f1f048bae654e43cf95984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 9 Jul 2021 15:16:49 +0800 Subject: fix completion: incorrect callback --- test/completion/init.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test') diff --git a/test/completion/init.lua b/test/completion/init.lua index 327d72a4..9b1c55c1 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -2588,3 +2588,29 @@ t.GGG$ kind = define.CompletionItemKind.Function, }, } + +TEST [[ +---@param f fun(a: any, b: any):boolean +local function f(f) end + +f(fun$) +]] +{ + { + label = 'fun(a: any, b: any):boolean', + kind = define.CompletionItemKind.Function, + textEdit = { + newText = 'function (${1:a}, ${2:b})\n\t$0\nend', + start = 68, + finish = 70, + } + }, + { + label = 'function', + kind = define.CompletionItemKind.Keyword, + }, + { + label = 'function ()', + kind = define.CompletionItemKind.Snippet, + } +} -- cgit v1.2.3