diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-22 11:44:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-22 11:44:58 +0800 |
commit | b622ee7be1f09100f7ce0e8098acd2257a42e702 (patch) | |
tree | 1b3d1c7ba1c9d23a0bd5e9373525f006ec2c8297 /server | |
parent | 47cfc4608a7f26a0e635ea6b33c3fa3f3fca3883 (diff) | |
download | lua-language-server-b622ee7be1f09100f7ce0e8098acd2257a42e702.zip |
调整一些关键字片段
Diffstat (limited to 'server')
-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]] |