From dda942debe0ea178f07b75989b2ba6942786e218 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Apr 2020 11:01:37 +0200 Subject: Pull enabled check up --- crates/ra_flycheck/src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'crates/ra_flycheck') diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index f6f9171ad..b6bb9da4b 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs @@ -24,7 +24,6 @@ pub use crate::conv::url_from_path_with_drive_lowercasing; #[derive(Clone, Debug)] pub struct CheckConfig { - pub enable: bool, pub args: Vec, pub command: String, pub all_targets: bool, @@ -216,9 +215,6 @@ impl CheckWatcherThread { // First, clear and cancel the old thread self.message_recv = never(); self.check_process = None; - if !self.options.enable { - return; - } let mut args: Vec = vec![ self.options.command.clone(), -- cgit v1.2.3 From 3990d971e54b69949f26bbbc530fa22fdc2fcd7f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Apr 2020 11:09:19 +0200 Subject: Crisper name https://www.flycheck.org/en/latest/ --- crates/ra_flycheck/src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/ra_flycheck') diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index b6bb9da4b..2990c1f95 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs @@ -29,27 +29,27 @@ pub struct CheckConfig { pub all_targets: bool, } -/// CheckWatcher wraps the shared state and communication machinery used for +/// Flycheck wraps the shared state and communication machinery used for /// running `cargo check` (or other compatible command) and providing /// diagnostics based on the output. /// The spawned thread is shut down when this struct is dropped. #[derive(Debug)] -pub struct CheckWatcher { +pub struct Flycheck { // XXX: drop order is significant cmd_send: Sender, handle: Option>, pub task_recv: Receiver, } -impl CheckWatcher { - pub fn new(config: CheckConfig, workspace_root: PathBuf) -> CheckWatcher { +impl Flycheck { + pub fn new(config: CheckConfig, workspace_root: PathBuf) -> Flycheck { let (task_send, task_recv) = unbounded::(); let (cmd_send, cmd_recv) = unbounded::(); let handle = jod_thread::spawn(move || { - let mut check = CheckWatcherThread::new(config, workspace_root); + let mut check = FlycheckThread::new(config, workspace_root); check.run(&task_send, &cmd_recv); }); - CheckWatcher { task_recv, cmd_send, handle: Some(handle) } + Flycheck { task_recv, cmd_send, handle: Some(handle) } } /// Schedule a re-start of the cargo check worker. @@ -75,7 +75,7 @@ pub enum CheckCommand { Update, } -struct CheckWatcherThread { +struct FlycheckThread { options: CheckConfig, workspace_root: PathBuf, last_update_req: Option, @@ -89,9 +89,9 @@ struct CheckWatcherThread { check_process: Option>, } -impl CheckWatcherThread { - fn new(options: CheckConfig, workspace_root: PathBuf) -> CheckWatcherThread { - CheckWatcherThread { +impl FlycheckThread { + fn new(options: CheckConfig, workspace_root: PathBuf) -> FlycheckThread { + FlycheckThread { options, workspace_root, last_update_req: None, -- cgit v1.2.3 From b5306ea70659aad28b1a5de248128b47a5e5f1bf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Apr 2020 11:16:43 +0200 Subject: Simplify --- crates/ra_flycheck/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_flycheck') diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index 2990c1f95..75aece45f 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs @@ -37,7 +37,7 @@ pub struct CheckConfig { pub struct Flycheck { // XXX: drop order is significant cmd_send: Sender, - handle: Option>, + handle: jod_thread::JoinHandle<()>, pub task_recv: Receiver, } @@ -49,7 +49,7 @@ impl Flycheck { let mut check = FlycheckThread::new(config, workspace_root); check.run(&task_send, &cmd_recv); }); - Flycheck { task_recv, cmd_send, handle: Some(handle) } + Flycheck { task_recv, cmd_send, handle } } /// Schedule a re-start of the cargo check worker. -- cgit v1.2.3