From a635c9700c0b99c3ad128c21727fdcfb23bad72f Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 3 Feb 2023 19:15:16 +0000 Subject: refactor: reland "preserve ProcState::file_fetcher between restarts" (#17636) Just some watcher init step that I thought would be "cloned over" but needs to be done again on reset. --- cli/cache/parsed_source.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cli/cache/parsed_source.rs') diff --git a/cli/cache/parsed_source.rs b/cli/cache/parsed_source.rs index 30eecf702..6385e7384 100644 --- a/cli/cache/parsed_source.rs +++ b/cli/cache/parsed_source.rs @@ -67,6 +67,14 @@ impl ParsedSourceCache { } } + pub fn reset_for_file_watcher(&self) -> Self { + Self { + db_cache_path: self.db_cache_path.clone(), + cli_version: self.cli_version.clone(), + sources: Default::default(), + } + } + pub fn get_parsed_source_from_module( &self, module: &deno_graph::Module, -- cgit v1.2.3