From b622ee7be1f09100f7ce0e8098acd2257a42e702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 22 Oct 2019 11:44:58 +0800 Subject: =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=BA=9B=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97=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 | 4 +++- server/src/core/snippet.lua | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 23ba5f1b..756f136b 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -398,7 +398,9 @@ local function searchKeyWords(vm, source, word, callback) for _, key in ipairs(KEYS) do if matchKey(word, key) then if snippet.key[key] then - if snipType ~= 'Replace' then + if snipType ~= 'Replace' + or key == 'local' + or key == 'return' then callback(key, nil, CompletionItemKind.Keyword) end if snipType ~= 'Disable' then diff --git a/server/src/core/snippet.lua b/server/src/core/snippet.lua index a4458788..7532ce9b 100644 --- a/server/src/core/snippet.lua +++ b/server/src/core/snippet.lua @@ -33,13 +33,8 @@ for ${1:i} = ${2:1}, ${3:10, 2} do $0 end]] -add('key', 'function', 'function name()') [[ -function ${1:name}(${2:arg1, arg2, arg3}) - $0 -end]] - add('key', 'function', 'function ()') [[ -function (${1:arg1, arg2, arg3}) +function $1(${2:arg1, arg2, arg3}) $0 end]] -- cgit v1.2.3