File tree Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,8 @@ CLI_CHECK_INITING =
646646' Initializing ...'
647647CLI_CHECK_SUCCESS =
648648' Diagnosis completed, no problems found'
649+ CLI_CHECK_PROGRESS =
650+ ' Found {} problems in {} files'
649651CLI_CHECK_RESULTS =
650652' Diagnosis complete, {} problems found, see {}'
651653CLI_DOC_INITING =
Original file line number Diff line number Diff line change @@ -646,6 +646,8 @@ CLI_CHECK_INITING =
646646' Inicializando ...'
647647CLI_CHECK_SUCCESS =
648648' Diagnóstico completo, nenhum problema encontrado'
649+ CLI_CHECK_PROGRESS = -- TODO: need translate!
650+ ' Found {} problems in {} files'
649651CLI_CHECK_RESULTS =
650652' Diagnóstico completo, {} problemas encontrados, veja {}'
651653CLI_DOC_INITING = -- TODO: need translate!
Original file line number Diff line number Diff line change @@ -646,6 +646,8 @@ CLI_CHECK_INITING =
646646' 正在初始化...'
647647CLI_CHECK_SUCCESS =
648648' 诊断完成,没有发现问题'
649+ CLI_CHECK_PROGRESS = -- TODO: need translate!
650+ ' Found {} problems in {} files'
649651CLI_CHECK_RESULTS =
650652' 诊断完成,共有 {} 个问题,请查看 {}'
651653CLI_DOC_INITING =
Original file line number Diff line number Diff line change @@ -646,6 +646,8 @@ CLI_CHECK_INITING =
646646' 正在初始化...'
647647CLI_CHECK_SUCCESS =
648648' 診斷完成,沒有發現問題'
649+ CLI_CHECK_PROGRESS = -- TODO: need translate!
650+ ' Found {} problems in {} files'
649651CLI_CHECK_RESULTS =
650652' 診斷完成,共有 {} 個問題,請查看 {}'
651653CLI_DOC_INITING = -- TODO: need translate!
Original file line number Diff line number Diff line change @@ -76,15 +76,27 @@ lclient():start(function (client)
7676 for i , uri in ipairs (uris ) do
7777 files .open (uri )
7878 diag .doDiagnostic (uri , true )
79- if os.clock () - lastClock > 0.2 then
79+ -- Print regularly but always print the last entry to ensure that logs written to files don't look incomplete.
80+ if os.clock () - lastClock > 0.2 or i == # uris then
8081 lastClock = os.clock ()
82+ client :update ()
8183 local output = ' \x0D '
8284 .. (' >' ):rep (math.ceil (i / max * 20 ))
8385 .. (' =' ):rep (20 - math.ceil (i / max * 20 ))
8486 .. ' '
8587 .. (' 0' ):rep (# tostring (max ) - # tostring (i ))
8688 .. tostring (i ) .. ' /' .. tostring (max )
8789 io.write (output )
90+ local filesWithErrors = 0
91+ local errors = 0
92+ for _ , diags in pairs (results ) do
93+ filesWithErrors = filesWithErrors + 1
94+ errors = errors + # diags
95+ end
96+ if errors > 0 then
97+ local errorDetails = ' [' .. lang .script (' CLI_CHECK_PROGRESS' , errors , filesWithErrors ) .. ' ]'
98+ io.write (errorDetails )
99+ end
88100 io.flush ()
89101 end
90102 end
You can’t perform that action at this time.
0 commit comments