From fdfc8f3e3b8ce9d22efba6efe24f1b8650e1d85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 9 Nov 2021 19:41:29 +0800 Subject: cleanup --- script/provider/diagnostic.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'script/provider/diagnostic.lua') 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() -- cgit v1.2.3