diff options
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r-- | script/provider/diagnostic.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index ca4bcdb8..5630d44f 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -29,7 +29,7 @@ local function buildSyntaxError(uri, err) local message = lang.script('PARSER_'..err.type, err.info) if err.version then - local version = err.info and err.info.version or config.get 'Lua.runtime.version' + local version = err.info and err.info.version or config.get(nil, 'Lua.runtime.version') message = message .. ('(%s)'):format(lang.script('DIAG_NEED_VERSION' , concat(err.version, '/') , version @@ -159,7 +159,7 @@ function m.syntaxErrors(uri, ast) pcall(function () for _, err in ipairs(ast.errs) do - if not config.get 'Lua.diagnostics.disable'[err.type:lower():gsub('_', '-')] then + if not config.get(nil, 'Lua.diagnostics.disable')[err.type:lower():gsub('_', '-')] then results[#results+1] = buildSyntaxError(uri, err) end end @@ -189,11 +189,11 @@ end ---@async function m.doDiagnostic(uri) - if not config.get 'Lua.diagnostics.enable' then + if not config.get(nil, 'Lua.diagnostics.enable') then return end if files.isLibrary(uri) then - local status = config.get 'Lua.diagnostics.libraryFiles' + local status = config.get(nil, 'Lua.diagnostics.libraryFiles') if status == 'Disable' then return elseif status == 'Opened' then @@ -203,7 +203,7 @@ function m.doDiagnostic(uri) end end if ws.isIgnored(uri) then - local status = config.get 'Lua.diagnostics.ignoredFiles' + local status = config.get(nil, 'Lua.diagnostics.ignoredFiles') if status == 'Disable' then return elseif status == 'Opened' then @@ -333,14 +333,14 @@ local function askForDisable() end function m.diagnosticsAll(force) - if not force and not config.get 'Lua.diagnostics.enable' then + if not force and not config.get(nil, 'Lua.diagnostics.enable') then m.clearAll() return end if not m._start then return end - local delay = config.get 'Lua.diagnostics.workspaceDelay' / 1000 + local delay = config.get(nil, 'Lua.diagnostics.workspaceDelay') / 1000 if not force and delay < 0 then return end @@ -393,7 +393,7 @@ function m.checkWorkspaceDiag() if not await.hasID 'diagnosticsAll' then return end - local speedRate = config.get 'Lua.diagnostics.workspaceRate' + local speedRate = config.get(nil, 'Lua.diagnostics.workspaceRate') if speedRate <= 0 or speedRate >= 100 then return end |