summaryrefslogtreecommitdiff
path: root/server/src/method
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/method')
-rw-r--r--server/src/method/textDocument/codeAction.lua20
-rw-r--r--server/src/method/workspace/executeCommand.lua5
2 files changed, 14 insertions, 11 deletions
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 = {
{
diff --git a/server/src/method/workspace/executeCommand.lua b/server/src/method/workspace/executeCommand.lua
index 173eaa22..0d579848 100644
--- a/server/src/method/workspace/executeCommand.lua
+++ b/server/src/method/workspace/executeCommand.lua
@@ -2,6 +2,7 @@ local fs = require 'bee.filesystem'
local json = require 'json'
local config = require 'config'
local rpc = require 'rpc'
+local lang = require 'language'
local command = {}
@@ -109,7 +110,7 @@ function command.removeSpace(lsp, data)
end
rpc:request('workspace/applyEdit', {
- label = '清除所有后置空格',
+ label = lang.script.COMMAND_REMOVE_SPACE,
edit = {
changes = {
[uri] = textEdit,
@@ -148,7 +149,7 @@ function command.solve(lsp, data)
end
rpc:request('workspace/applyEdit', {
- label = '添加括号',
+ label = lang.script.COMMAND_ADD_BRACKETS,
edit = {
changes = {
[uri] = {