From e7bd33ff213afb6f4d6d666d215107651ab27a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 28 Mar 2019 15:45:31 +0800 Subject: =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/codeAction.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'server/src/method/textDocument') diff --git a/server/src/method/textDocument/codeAction.lua b/server/src/method/textDocument/codeAction.lua index 80faee51..e2ff2e50 100644 --- a/server/src/method/textDocument/codeAction.lua +++ b/server/src/method/textDocument/codeAction.lua @@ -1,9 +1,11 @@ +local lang = require 'language' + local function disableDiagnostic(lsp, uri, data, callback) callback { - title = ('禁用诊断(%s)'):format(data.code), + title = lang.script('ACTION_DISABLE_DIAG', data.code), kind = 'quickfix', command = { - title = '禁用诊断', + title = lang.script.COMMAND_DISABLE_DIAG, command = 'config', arguments = { { @@ -28,10 +30,10 @@ local function solveUndefinedGlobal(lsp, uri, data, callback) return end callback { - title = ('标记 `%s` 为已定义的全局变量'):format(name), + title = lang.script('ACTION_MARK_GLOBAL', name), kind = 'quickfix', command = { - title = '标记全局变量', + title = lang.script.COMMAND_MARK_GLOBAL, command = 'config', arguments = { { @@ -46,10 +48,10 @@ end local function solveTrailingSpace(lsp, uri, data, callback) callback { - title = '清除所有后置空格', + title = lang.script.ACTION_REMOVE_SPACE, kind = 'quickfix', command = { - title = '清除所有后置空格', + title = lang.script.COMMAND_REMOVE_SPACE, command = 'removeSpace', arguments = { { @@ -62,7 +64,7 @@ end local function solveNewlineCall(lsp, uri, data, callback) callback { - title = '添加 `;`', + title = lang.script.ACTION_ADD_SEMICOLON, kind = 'quickfix', edit = { changes = { @@ -82,10 +84,10 @@ end local function solveAmbiguity1(lsp, uri, data, callback) callback { - title = '添加括号', + title = lang.script.ACTION_ADD_BRACKETS, kind = 'quickfix', command = { - title = '添加括号', + title = lang.script.COMMAND_ADD_BRACKETS, command = 'solve', arguments = { { -- cgit v1.2.3