diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-03-01 20:26:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-03-01 20:26:43 +0800 |
commit | 6aa49faddea1c572140b84a72a8bfa850d9143fd (patch) | |
tree | 6e18b0cdf2c138a688a933c2555504f6a8de8290 /script | |
parent | 66f23015c4398d6b991882127b1f0af33e2f25c1 (diff) | |
download | lua-language-server-6aa49faddea1c572140b84a72a8bfa850d9143fd.zip |
locale
Diffstat (limited to 'script')
-rw-r--r-- | script/cli/check.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/script/cli/check.lua b/script/cli/check.lua index 670b10f4..dd2e7737 100644 --- a/script/cli/check.lua +++ b/script/cli/check.lua @@ -8,17 +8,27 @@ local json = require 'json-beautify' local lang = require 'language' local define = require 'proto.define' local config = require 'config.config' -local timer = require 'timer' -local platform = require 'bee.platform' + +lang(LOCALE) if type(CHECK) ~= 'string' then - print(('The argument of CHECK must be a string, but got %s'):format(type(CHECK))) + print(lang.script('CLI_CHECK_ERROR_TYPE', type(CHECK))) + return end local rootUri = furi.encode(CHECK) if not rootUri then - print(('The argument of CHECK must be a valid uri, but got %s'):format(CHECK)) + print(lang.script('CLI_CHECK_ERROR_URI', CHECK)) + return +end + +if CHECKLEVEL then + if not define.DiagnosticSeverity[CHECKLEVEL] then + print(lang.script('CLI_CHECK_ERROR_LEVEL', 'Error, Warning, Information, Hint')) + return + end end +local checkLevel = define.DiagnosticSeverity[CHECKLEVEL] or define.DiagnosticSeverity.Warning util.enableCloseFunction() @@ -40,7 +50,6 @@ lclient():start(function (client) ws.awaitReady(rootUri) - local checkLevel = define.DiagnosticSeverity[CHECKLEVEL] or define.DiagnosticSeverity.Warning local disables = config.get(rootUri, 'Lua.diagnostics.disable') for name, serverity in pairs(define.DiagnosticDefaultSeverity) do serverity = config.get(rootUri, 'Lua.diagnostics.severity')[name] or 'Warning' |