summaryrefslogtreecommitdiff
path: root/script-beta/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-12 11:39:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-12 11:39:51 +0800
commitb9d4d1d00e72cb0204eeec8feaac4fff13e6b353 (patch)
tree1c0a7ae33dd3d249e86cea8ef7f59b73767eeba0 /script-beta/provider
parent812180e032c0149f0d96c00d418df3e4f9dc8c09 (diff)
downloadlua-language-server-b9d4d1d00e72cb0204eeec8feaac4fff13e6b353.zip
fix #251 忘了支持 Lua.diagnostics.enable
Diffstat (limited to 'script-beta/provider')
-rw-r--r--script-beta/provider/diagnostic.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/script-beta/provider/diagnostic.lua b/script-beta/provider/diagnostic.lua
index 97d6480c..845b9f44 100644
--- a/script-beta/provider/diagnostic.lua
+++ b/script-beta/provider/diagnostic.lua
@@ -119,6 +119,12 @@ function m.clear(uri)
})
end
+function m.clearAll()
+ for luri in pairs(m.cache) do
+ m.clear(luri)
+ end
+end
+
function m.syntaxErrors(uri, ast)
if #ast.errs == 0 then
return nil
@@ -149,6 +155,9 @@ function m.diagnostics(uri, diags)
end
function m.doDiagnostic(uri)
+ if not config.config.diagnostics.enable then
+ return
+ end
uri = uri:lower()
if files.isLibrary(uri) then
return
@@ -212,6 +221,10 @@ function m.refresh(uri)
end
function m.diagnosticsAll()
+ if not config.config.diagnostics.enable then
+ m.clearAll()
+ return
+ end
if not m._start then
return
end