diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-03-01 20:16:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-03-01 20:16:29 +0800 |
commit | 66f23015c4398d6b991882127b1f0af33e2f25c1 (patch) | |
tree | d6fb99bd8b10d3abc12123e0df1b5a815792c77a /script/cli | |
parent | 268aee4c5e0851b9cd5a391569bec5371aa124eb (diff) | |
download | lua-language-server-66f23015c4398d6b991882127b1f0af33e2f25c1.zip |
update
Diffstat (limited to 'script/cli')
-rw-r--r-- | script/cli/check.lua | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/script/cli/check.lua b/script/cli/check.lua index e5385c4e..670b10f4 100644 --- a/script/cli/check.lua +++ b/script/cli/check.lua @@ -1,13 +1,15 @@ -local lclient = require 'lclient' -local furi = require 'file-uri' -local ws = require 'workspace' -local files = require 'files' -local diag = require 'provider.diagnostic' -local util = require 'utility' -local json = require 'json-beautify' -local lang = require 'language' -local define = require 'proto.define' -local config = require 'config.config' +local lclient = require 'lclient' +local furi = require 'file-uri' +local ws = require 'workspace' +local files = require 'files' +local diag = require 'provider.diagnostic' +local util = require 'utility' +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' if type(CHECK) ~= 'string' then print(('The argument of CHECK must be a string, but got %s'):format(type(CHECK))) @@ -34,6 +36,8 @@ lclient():start(function (client) results[params.uri] = params.diagnostics end) + io.write(lang.script('CLI_CHECK_INITING')) + ws.awaitReady(rootUri) local checkLevel = define.DiagnosticSeverity[CHECKLEVEL] or define.DiagnosticSeverity.Warning @@ -53,9 +57,16 @@ lclient():start(function (client) diag.doDiagnostic(uri, true) if os.clock() - lastClock > 0.2 then lastClock = os.clock() - print(('%d/%d'):format(i, max)) + local output = '\x0D' + .. ('>'):rep(math.ceil(i / max * 20)) + .. ('='):rep(20 - math.ceil(i / max * 20)) + .. ' ' + .. ('0'):rep(#tostring(max) - #tostring(i)) + .. tostring(i) .. '/' .. tostring(max) + io.write(output) end end + io.write('\x0D') end) local count = 0 |