summaryrefslogtreecommitdiff
path: root/script/provider/diagnostic.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-01 16:31:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-01 16:31:18 +0800
commit3011a124fe961bb623fa627abfd64030f128b4c1 (patch)
treedb3715606e005dd5a444356c58cb3e36f488179a /script/provider/diagnostic.lua
parent329e2d7dfa0268a6288086f1a2e3581d5b31cfc6 (diff)
downloadlua-language-server-3011a124fe961bb623fa627abfd64030f128b4c1.zip
cleanup
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r--script/provider/diagnostic.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 30efe53e..d461ed3c 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -26,7 +26,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.config.runtime.version
+ local version = err.info and err.info.version or config.Lua.runtime.version
message = message .. ('(%s)'):format(lang.script('DIAG_NEED_VERSION'
, concat(err.version, '/')
, version
@@ -151,7 +151,7 @@ function m.syntaxErrors(uri, ast)
local results = {}
for _, err in ipairs(ast.errs) do
- if not config.config.diagnostics.disable[err.type:lower():gsub('_', '-')] then
+ if not config.Lua.diagnostics.disable[err.type:lower():gsub('_', '-')] then
results[#results+1] = buildSyntaxError(uri, err)
end
end
@@ -179,7 +179,7 @@ function m.diagnostics(uri, diags)
end
function m.doDiagnostic(uri)
- if not config.config.diagnostics.enable then
+ if not config.Lua.diagnostics.enable then
return
end
uri = files.asKey(uri)
@@ -302,14 +302,14 @@ local function askForDisable()
end
function m.diagnosticsAll()
- if not config.config.diagnostics.enable then
+ if not config.Lua.diagnostics.enable then
m.clearAll()
return
end
if not m._start then
return
end
- local delay = config.config.diagnostics.workspaceDelay / 1000
+ local delay = config.Lua.diagnostics.workspaceDelay / 1000
if delay < 0 then
return
end
@@ -361,7 +361,7 @@ function m.checkWorkspaceDiag()
if not await.hasID 'diagnosticsAll' then
return
end
- local speedRate = config.config.diagnostics.workspaceRate
+ local speedRate = config.Lua.diagnostics.workspaceRate
if speedRate <= 0 or speedRate >= 100 then
return
end