summaryrefslogtreecommitdiff
path: root/script/provider/diagnostic.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-09 19:41:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-09 19:41:29 +0800
commitfdfc8f3e3b8ce9d22efba6efe24f1b8650e1d85c (patch)
tree70c98a9dbc79ac89f74002dc8121ebc16a957744 /script/provider/diagnostic.lua
parent00a0f93354e11472ac65e407652d54db32782ef0 (diff)
downloadlua-language-server-fdfc8f3e3b8ce9d22efba6efe24f1b8650e1d85c.zip
cleanup
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r--script/provider/diagnostic.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index f60a9149..ca4bcdb8 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -11,6 +11,7 @@ local progress = require "progress"
local client = require 'client'
local converter = require 'proto.converter'
+---@class diagnosticProvider
local m = {}
m._start = false
m.cache = {}
@@ -139,6 +140,10 @@ function m.clear(uri)
log.debug('clearDiagnostics', uri)
end
+function m.clearCache(uri)
+ m.cache[uri] = false
+end
+
function m.clearAll()
for luri in pairs(m.cache) do
m.clear(luri)
@@ -274,7 +279,7 @@ function m.refresh(uri)
await.call(function () ---@async
await.delay()
if uri then
- m.clear(uri)
+ m.clearCache(uri)
xpcall(m.doDiagnostic, log.error, uri)
end
m.diagnosticsAll()