From 2220abed24856f8f6265b6126de128540c429dea 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, 28 Aug 2019 14:45:55 +0800 Subject: =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=20local=20function=20=E7=9A=84=E7=89=87=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/completion.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/src') diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index d5078a07..5b30a57c 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -461,6 +461,12 @@ local function searchAsLocal(vm, source, word, callback) -- 特殊支持 local function if matchKey(word, 'function') then callback('function', nil, CompletionItemKind.Keyword) + -- TODO 需要有更优美的实现方式 + local data = snippet.key['function'][1] + callback(data.label, nil, CompletionItemKind.Snippet, { + insertTextFormat = 2, + insertText = data.text, + }) end end -- cgit v1.2.3