aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cargo_watch/src
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2020-01-11 20:32:40 +0000
committerEmil Lauridsen <[email protected]>2020-01-11 20:32:40 +0000
commit480c44918c73922b134b670cbd33014b8fcfc883 (patch)
treed26ccf2d4cce9639b6f7b3373734d989c8861ba0 /crates/ra_cargo_watch/src
parentd6da18e99d2fb4e67e3bc7503059282b5e14bd13 (diff)
Disable cargo checking in workspaces with no cargo projects
Diffstat (limited to 'crates/ra_cargo_watch/src')
-rw-r--r--crates/ra_cargo_watch/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
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 {
58 CheckWatcher { task_recv, cmd_send: Some(cmd_send), handle: Some(handle), shared } 58 CheckWatcher { task_recv, cmd_send: Some(cmd_send), handle: Some(handle), shared }
59 } 59 }
60 60
61 /// Returns a CheckWatcher that doesn't actually do anything
62 pub fn dummy() -> CheckWatcher {
63 let shared = Arc::new(RwLock::new(CheckWatcherSharedState::new()));
64 CheckWatcher { task_recv: never(), cmd_send: None, handle: None, shared }
65 }
66
61 /// Schedule a re-start of the cargo check worker. 67 /// Schedule a re-start of the cargo check worker.
62 pub fn update(&self) { 68 pub fn update(&self) {
63 if let Some(cmd_send) = &self.cmd_send { 69 if let Some(cmd_send) = &self.cmd_send {