summaryrefslogtreecommitdiff
path: root/cli/lsp/npm.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-05-03 20:52:58 +0100
committerGitHub <noreply@github.com>2024-05-03 20:52:58 +0100
commit1fce59281c38c83c937c01ff92f8656da44ccada (patch)
tree7ffa1af160cbc39062f17b82a3ab57b61d0d77de /cli/lsp/npm.rs
parent02d0ff58d2bab24ebbd1e61afe6b571ff4c415af (diff)
refactor(lsp): cleanup cache and module registry update (#23620)
Diffstat (limited to 'cli/lsp/npm.rs')
-rw-r--r--cli/lsp/npm.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/lsp/npm.rs b/cli/lsp/npm.rs
index 830aaed95..6cd6882b4 100644
--- a/cli/lsp/npm.rs
+++ b/cli/lsp/npm.rs
@@ -34,6 +34,12 @@ impl CliNpmSearchApi {
versions_cache: Default::default(),
}
}
+
+ pub fn clear_cache(&self) {
+ self.file_fetcher.clear_memory_files();
+ self.search_cache.clear();
+ self.versions_cache.clear();
+ }
}
#[async_trait::async_trait]