diff --git a/cli/lsp/cache.rs b/cli/lsp/cache.rs index 249177a64e..6e213778dc 100644 --- a/cli/lsp/cache.rs +++ b/cli/lsp/cache.rs @@ -210,4 +210,8 @@ impl CacheMetadata { self.cache = http_cache::HttpCache::new(location); self.metadata.lock().clear(); } + + pub fn clear_metadata(&self) { + self.metadata.lock().clear(); + } } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index fdda1aeecd..2115157a81 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -2816,7 +2816,9 @@ impl Inner { // now that we have dependencies loaded, we need to re-analyze them and // invalidate some diagnostics - self.diagnostics_server.invalidate(&[referrer]); + // self.diagnostics_server.invalidate(&[referrer]); + self.diagnostics_server.invalidate_all(); + self.cache_metadata.clear_metadata(); self.send_diagnostics_update(); self.send_testing_update();