diff options
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/completion.lua | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 54f96295..16b2ad4c 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -488,14 +488,25 @@ local function searchSpecial(vm, source, word, callback, pos) end end -- 4. 创建代码片段 - local label = table.concat(chars) .. '+1' - callback(label, nil, CompletionItemKind.Snippet, { - textEdit = { - start = inside.start + 1, - finish = index.finish, - newText = ('%s] = '):format(label), - }, - }) + if simple:get 'as action' then + local label = table.concat(chars) .. '+1' + callback(label, nil, CompletionItemKind.Snippet, { + textEdit = { + start = inside.start + 1, + finish = index.finish, + newText = ('%s] = '):format(label), + }, + }) + else + local label = table.concat(chars) + callback(label, nil, CompletionItemKind.Snippet, { + textEdit = { + start = inside.start + 1, + finish = index.finish, + newText = ('%s]'):format(label), + }, + }) + end end local function makeList(source, word) |