diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-10-19 07:05:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 07:05:00 +0200 |
commit | 8d9fef3b8955eadfd4820455b422b5bec1cdad0a (patch) | |
tree | 7114c3e3c329c83ce1d9c90e8fab5c7104bd1579 /cli/tools/lint.rs | |
parent | 5095af78018f1d77374bc06cbb58231e631056b9 (diff) |
refactor: add WatcherCommunicator helper struct (#20927)
This commit introduces "WatcherCommunicator" struct that
is used facilitate bi-directional communication between CLI
file watcher and the watched function.
Prerequisite for https://github.com/denoland/deno/pull/20876
Diffstat (limited to 'cli/tools/lint.rs')
-rw-r--r-- | cli/tools/lint.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs index 6a308b599..b7f4a3f0d 100644 --- a/cli/tools/lint.rs +++ b/cli/tools/lint.rs @@ -63,7 +63,7 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { job_name: "Lint".to_string(), clear_screen: !watch_flags.no_clear_screen, }, - move |flags, sender, changed_paths| { + move |flags, watcher_communicator, changed_paths| { let lint_flags = lint_flags.clone(); Ok(async move { let factory = CliFactory::from_flags(flags).await?; @@ -77,7 +77,7 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { Ok(files) } })?; - _ = sender.send(files.clone()); + _ = watcher_communicator.watch_paths(files.clone()); let lint_paths = if let Some(paths) = changed_paths { // lint all files on any changed (https://github.com/denoland/deno/issues/12446) |