From 1fce59281c38c83c937c01ff92f8656da44ccada Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 3 May 2024 20:52:58 +0100 Subject: refactor(lsp): cleanup cache and module registry update (#23620) --- cli/file_fetcher.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cli/file_fetcher.rs') diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index ee226ca34..01e1e3158 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -116,6 +116,10 @@ impl MemoryFiles { pub fn insert(&self, specifier: ModuleSpecifier, file: File) -> Option { self.0.lock().insert(specifier, file) } + + pub fn clear(&self) { + self.0.lock().clear(); + } } /// Fetch a source file from the local file system. @@ -616,6 +620,10 @@ impl FileFetcher { pub fn insert_memory_files(&self, file: File) -> Option { self.memory_files.insert(file.specifier.clone(), file) } + + pub fn clear_memory_files(&self) { + self.memory_files.clear(); + } } #[derive(Debug, Eq, PartialEq)] -- cgit v1.2.3