From 480c44918c73922b134b670cbd33014b8fcfc883 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Sat, 11 Jan 2020 21:32:40 +0100 Subject: Disable cargo checking in workspaces with no cargo projects --- crates/ra_cargo_watch/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_cargo_watch/src') diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs index 9bc0fd405..cb0856aa4 100644 --- a/crates/ra_cargo_watch/src/lib.rs +++ b/crates/ra_cargo_watch/src/lib.rs @@ -58,6 +58,12 @@ impl CheckWatcher { CheckWatcher { task_recv, cmd_send: Some(cmd_send), handle: Some(handle), shared } } + /// Returns a CheckWatcher that doesn't actually do anything + pub fn dummy() -> CheckWatcher { + let shared = Arc::new(RwLock::new(CheckWatcherSharedState::new())); + CheckWatcher { task_recv: never(), cmd_send: None, handle: None, shared } + } + /// Schedule a re-start of the cargo check worker. pub fn update(&self) { if let Some(cmd_send) = &self.cmd_send { -- cgit v1.2.3