summaryrefslogtreecommitdiff
path: root/script/core/completion/postfix.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-15 20:10:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-15 20:10:00 +0800
commit12d6a9eb75f31b64cbc89eb3265805bc8dad01f0 (patch)
tree031a449c1222ef1705d34fbb22c11ef1ea388ee5 /script/core/completion/postfix.lua
parentbf8b18fe8d2f3cc470021e32b9d5f11ec765a643 (diff)
downloadlua-language-server-12d6a9eb75f31b64cbc89eb3265805bc8dad01f0.zip
cleanup
Diffstat (limited to 'script/core/completion/postfix.lua')
-rw-r--r--script/core/completion/postfix.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/script/core/completion/postfix.lua b/script/core/completion/postfix.lua
index 3b58d0b2..98bd0639 100644
--- a/script/core/completion/postfix.lua
+++ b/script/core/completion/postfix.lua
@@ -50,17 +50,17 @@ register 'function' {
register 'method' {
function (state, source, callback)
- if source.type == 'getfield' then
+ if source.type == 'getfield' then
if hasNonFieldInNode(source) then
return
end
local subber = subString(state)
callback(string.format('function %s:%s($1)\n\t$0\nend'
, subber(source.start + 1, source.dot.start)
- , subber(source.dot .finish + 1, source.finish)
+ , subber(source.dot.finish + 1, source.finish)
))
end
- if source.type == 'getmethod' then
+ if source.type == 'getmethod' then
if hasNonFieldInNode(source.parent) then
return
end
@@ -298,16 +298,18 @@ local function checkPostFix(state, word, wordPosition, position, symbol, results
if matchKey(word, action.key) then
action.data[1](state, source, function (newText)
results[#results+1] = {
- label = action.key,
- kind = define.CompletionItemKind.Event,
- description= markdown()
+ label = action.key,
+ kind = define.CompletionItemKind.Event,
+ description = markdown()
: add('lua', newText)
: string(),
- textEdit = {
+ textEdit = {
start = wordPosition + #symbol,
finish = position,
newText = newText,
},
+ sortText = ('postfix-%04d'):format(i),
+
additionalTextEdits = {
{
start = source.start,
@@ -315,7 +317,6 @@ local function checkPostFix(state, word, wordPosition, position, symbol, results
newText = '',
},
},
- sortText = ('postfix-%04d'):format(i),
}
end)
end