diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-09 19:41:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-09 19:41:29 +0800 |
commit | fdfc8f3e3b8ce9d22efba6efe24f1b8650e1d85c (patch) | |
tree | 70c98a9dbc79ac89f74002dc8121ebc16a957744 /script/provider/diagnostic.lua | |
parent | 00a0f93354e11472ac65e407652d54db32782ef0 (diff) | |
download | lua-language-server-fdfc8f3e3b8ce9d22efba6efe24f1b8650e1d85c.zip |
cleanup
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r-- | script/provider/diagnostic.lua | 7 |
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() |