diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/locale/en-US/script.lni | 4 | ||||
-rw-r--r-- | server/locale/zh-CN/script.lni | 4 | ||||
-rw-r--r-- | server/src/core/diagnostics.lua | 2 | ||||
-rw-r--r-- | server/src/method/textDocument/publishDiagnostics.lua | 5 |
4 files changed, 8 insertions, 7 deletions
diff --git a/server/locale/en-US/script.lni b/server/locale/en-US/script.lni index 0f36bd9f..a35729db 100644 --- a/server/locale/en-US/script.lni +++ b/server/locale/en-US/script.lni @@ -11,8 +11,8 @@ 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 {}' -DIAG_DEFINED_VERSION = 'Defined in {}' +DIAG_NEED_VERSION = 'Supported in {}, current is {}' +DIAG_DEFINED_VERSION = 'Defined in {}, current is {}' MWS_NOT_SUPPORT = '{} dose not support multi workspace for now, I may need to restart to support the new workspace ...' MWS_RESTART = 'Restart' diff --git a/server/locale/zh-CN/script.lni b/server/locale/zh-CN/script.lni index 7c541e98..960aa5a8 100644 --- a/server/locale/zh-CN/script.lni +++ b/server/locale/zh-CN/script.lni @@ -11,8 +11,8 @@ DIAG_AMBIGUITY_1 = '会优先运算 `0 {op} {num}`,你可能需要加 DIAG_LOWERCASE_GLOBAL = '首字母小写的全局变量' DIAG_DIAGNOSTICS = '诊断' DIAG_SYNTAX_CHECK = '语法检查' -DIAG_NEED_VERSION = '在 {} 中是合法的' -DIAG_DEFINED_VERSION = '在 {} 中有定义' +DIAG_NEED_VERSION = '在 {} 中是合法的,当前为 {}' +DIAG_DEFINED_VERSION = '在 {} 中有定义,当前为 {}' MWS_NOT_SUPPORT = '{} 目前还不支持多工作目录,我可能需要重启才能支持新的工作目录...' MWS_RESTART = '重启' diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua index a0cbb23d..600ee732 100644 --- a/server/src/core/diagnostics.lua +++ b/server/src/core/diagnostics.lua @@ -341,7 +341,7 @@ return function (vm, lines, uri) local message = lang.script('DIAG_UNDEF_GLOBAL', key) local otherVersion = library.other[key] if otherVersion then - message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_VERSION', table.concat(otherVersion, '/'))) + message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_VERSION', table.concat(otherVersion, '/'), config.config.runtime.version)) end return { level = DiagnosticSeverity.Warning, diff --git a/server/src/method/textDocument/publishDiagnostics.lua b/server/src/method/textDocument/publishDiagnostics.lua index fbe65bb3..f2e1a593 100644 --- a/server/src/method/textDocument/publishDiagnostics.lua +++ b/server/src/method/textDocument/publishDiagnostics.lua @@ -1,5 +1,6 @@ local core = require 'core' local lang = require 'language' +local config = require 'config' local DiagnosticSeverity = { Error = 1, @@ -84,9 +85,9 @@ local function buildError(err, lines, uri) } if err.version then if type(err.version) == 'table' then - diagnostic.message = ('%s(%s)'):format(diagnostic.message, lang.script('DIAG_NEED_VERSION', table.concat(err.version, '/'))) + diagnostic.message = ('%s(%s)'):format(diagnostic.message, lang.script('DIAG_NEED_VERSION', table.concat(err.version, '/'), config.config.runtime.version)) else - diagnostic.message = ('%s(%s)'):format(diagnostic.message, lang.script('DIAG_NEED_VERSION', err.version)) + diagnostic.message = ('%s(%s)'):format(diagnostic.message, lang.script('DIAG_NEED_VERSION', err.version, config.config.runtime.version)) end end if err.level == 'error' then |