diff options
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r-- | script/provider/diagnostic.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 5957e3eb..23dad33d 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -139,9 +139,9 @@ local function mergeDiags(a, b, c) end -- enable `push`, disable `clear` -function m.clear(uri) +function m.clear(uri, force) await.close('diag:' .. uri) - if m.cache[uri] == nil then + if m.cache[uri] == nil and not force then return end m.cache[uri] = nil @@ -169,9 +169,15 @@ function m.clearCacheExcept(uris) end end -function m.clearAll() - for luri in pairs(m.cache) do - m.clear(luri) +function m.clearAll(force) + if force then + for luri in files.eachFile() do + m.clear(luri, force) + end + else + for luri in pairs(m.cache) do + m.clear(luri) + end end end |