diff options
-rw-r--r-- | server/src/core/completion.lua | 4 | ||||
-rw-r--r-- | 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]] |