summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/locale/en-US/script.lni14
-rw-r--r--server/locale/zh-CN/script.lni14
-rw-r--r--server/src/method/textDocument/codeAction.lua2
-rw-r--r--server/src/parser/ast.lua3
4 files changed, 22 insertions, 11 deletions
diff --git a/server/locale/en-US/script.lni b/server/locale/en-US/script.lni
index dc2ee9ba..d994a404 100644
--- a/server/locale/en-US/script.lni
+++ b/server/locale/en-US/script.lni
@@ -11,6 +11,7 @@ DIAG_AMBIGUITY_1 = 'Compute `0 {op} {num}` first. You may need to add bra
DIAG_LOWERCASE_GLOBAL = 'Global variable in lowercase initial'
DIAG_DIAGNOSTICS = 'Diagnostics'
DIAG_SYNTAX_CHECK = 'Syntax Check'
+DIAG_NEED_VERSION = 'Supported in {}'
MWS_NOT_SUPPORT = '{} dose not support multi workspace for now, I may need to restart to support the new workspace ...'
MWS_RESTART = 'Restart'
@@ -40,19 +41,22 @@ PARSER_MALFORMED_NUMBER = 'Malformed number.'
PARSER_ACTION_AFTER_RETURN = '<eof> expected.'
PARSER_NO_VISIBLE_LABEL = 'No visible label `{label}` .'
PARSER_REDEFINE_LABEL = 'Label `{label}` already defined.'
+PARSER_TOCLOSE = '{version} does not support this grammar.'
SYMBOL_ANONYMOUS = '<Anonymous>'
-ACTION_DISABLE_DIAG = 'Disable diagnostics ({})'
-ACTION_MARK_GLOBAL = 'Mark `{}` as defined global'
-ACTION_REMOVE_SPACE = 'Clear all postemptive spaces'
-ACTION_ADD_SEMICOLON = 'Add `;`'
-ACTION_ADD_BRACKETS = 'Add brackets'
+ACTION_DISABLE_DIAG = 'Disable diagnostics ({}).'
+ACTION_MARK_GLOBAL = 'Mark `{}` as defined global.'
+ACTION_REMOVE_SPACE = 'Clear all postemptive spaces.'
+ACTION_ADD_SEMICOLON = 'Add `;` .'
+ACTION_ADD_BRACKETS = 'Add brackets.'
+ACTION_RUNTIME_VERSION = 'Change runtime version to {} .'
COMMAND_DISABLE_DIAG = 'Disable diagnostics'
COMMAND_MARK_GLOBAL = 'Mark defined global'
COMMAND_REMOVE_SPACE = 'Clear all postemptive spaces'
COMMAND_ADD_BRACKETS = 'Add brackets'
+COMMAND_RUNTIME_VERSION = 'Change runtime version'
DEBUG_MEMORY_LEAK = "{} I'm sorry for the serious memory leak. The language service will be restarted soon."
DEBUG_RESTART_NOW = 'Restart now'
diff --git a/server/locale/zh-CN/script.lni b/server/locale/zh-CN/script.lni
index 1cc6272a..343d903c 100644
--- a/server/locale/zh-CN/script.lni
+++ b/server/locale/zh-CN/script.lni
@@ -11,6 +11,7 @@ DIAG_AMBIGUITY_1 = '会优先运算 `0 {op} {num}`,你可能需要加
DIAG_LOWERCASE_GLOBAL = '首字母小写的全局变量'
DIAG_DIAGNOSTICS = '诊断'
DIAG_SYNTAX_CHECK = '语法检查'
+DIAG_NEED_VERSION = '在 {} 中是合法的'
MWS_NOT_SUPPORT = '{} 目前还不支持多工作目录,我可能需要重启才能支持新的工作目录...'
MWS_RESTART = '重启'
@@ -40,19 +41,22 @@ PARSER_MALFORMED_NUMBER = '无法构成有效数字。'
PARSER_ACTION_AFTER_RETURN = '`return`之后不能再执行代码。'
PARSER_NO_VISIBLE_LABEL = '标签`{label}`不可见。'
PARSER_REDEFINE_LABEL = '标签`{label}`重复定义。'
+PARSER_TOCLOSE = '{version} 不支持该语法。'
SYMBOL_ANONYMOUS = '<匿名函数>'
-ACTION_DISABLE_DIAG = '禁用诊断({})'
-ACTION_MARK_GLOBAL = '标记 `{}` 为已定义的全局变量'
-ACTION_REMOVE_SPACE = '清除所有后置空格'
-ACTION_ADD_SEMICOLON = '添加 `;`'
-ACTION_ADD_BRACKETS = '添加括号'
+ACTION_DISABLE_DIAG = '禁用诊断({})。'
+ACTION_MARK_GLOBAL = '标记 `{}` 为已定义的全局变量。'
+ACTION_REMOVE_SPACE = '清除所有后置空格。'
+ACTION_ADD_SEMICOLON = '添加 `;` 。'
+ACTION_ADD_BRACKETS = '添加括号。'
+ACTION_RUNTIME_VERSION = '修改运行版本为 {} 。'
COMMAND_DISABLE_DIAG = '禁用诊断'
COMMAND_MARK_GLOBAL = '标记全局变量'
COMMAND_REMOVE_SPACE = '清除所有后置空格'
COMMAND_ADD_BRACKETS = '添加括号'
+COMMAND_RUNTIME_VERSION = '修改运行版本'
DEBUG_MEMORY_LEAK = '{} 很抱歉发生了严重的内存泄漏,语言服务即将重启。'
DEBUG_RESTART_NOW = '立即重启'
diff --git a/server/src/method/textDocument/codeAction.lua b/server/src/method/textDocument/codeAction.lua
index 53987d2d..70e875a6 100644
--- a/server/src/method/textDocument/codeAction.lua
+++ b/server/src/method/textDocument/codeAction.lua
@@ -138,7 +138,7 @@ local function solveSyntax(lsp, uri, data, callback)
end
if err.version then
callback {
- title = lang.script.CHANGE_RUNTIME_VERSION,
+ title = lang.script('ACTION_RUNTIME_VERSION', err.version),
kind = 'quickfix',
command = {
title = lang.script.COMMAND_RUNTIME_VERSION,
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index 74f69d3c..1d4d6a23 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -1214,6 +1214,9 @@ local Defs = {
start = start,
finish = start + #'*toclose' - 1,
version = 'Lua 5.4',
+ info = {
+ version = State.Version,
+ }
}
end
}