@@ -8,17 +8,27 @@ local json = require 'json-beautify'
88local lang = require ' language'
99local define = require ' proto.define'
1010local config = require ' config.config'
11- local timer = require ' timer '
12- local platform = require ' bee.platform '
11+
12+ lang ( LOCALE )
1313
1414if type (CHECK ) ~= ' string' then
15- print ((' The argument of CHECK must be a string, but got %s' ):format (type (CHECK )))
15+ print (lang .script (' CLI_CHECK_ERROR_TYPE' , type (CHECK )))
16+ return
1617end
1718
1819local rootUri = furi .encode (CHECK )
1920if not rootUri then
20- print ((' The argument of CHECK must be a valid uri, but got %s' ):format (CHECK ))
21+ print (lang .script (' CLI_CHECK_ERROR_URI' , CHECK ))
22+ return
23+ end
24+
25+ if CHECKLEVEL then
26+ if not define .DiagnosticSeverity [CHECKLEVEL ] then
27+ print (lang .script (' CLI_CHECK_ERROR_LEVEL' , ' Error, Warning, Information, Hint' ))
28+ return
29+ end
2130end
31+ local checkLevel = define .DiagnosticSeverity [CHECKLEVEL ] or define .DiagnosticSeverity .Warning
2232
2333util .enableCloseFunction ()
2434
@@ -40,7 +50,6 @@ lclient():start(function (client)
4050
4151 ws .awaitReady (rootUri )
4252
43- local checkLevel = define .DiagnosticSeverity [CHECKLEVEL ] or define .DiagnosticSeverity .Warning
4453 local disables = config .get (rootUri , ' Lua.diagnostics.disable' )
4554 for name , serverity in pairs (define .DiagnosticDefaultSeverity ) do
4655 serverity = config .get (rootUri , ' Lua.diagnostics.severity' )[name ] or ' Warning'
0 commit comments