aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_flycheck
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_flycheck')
-rw-r--r--crates/ra_flycheck/src/lib.rs20
1 files changed, 10 insertions, 10 deletions
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 {
29 pub all_targets: bool, 29 pub all_targets: bool,
30} 30}
31 31
32/// CheckWatcher wraps the shared state and communication machinery used for 32/// Flycheck wraps the shared state and communication machinery used for
33/// running `cargo check` (or other compatible command) and providing 33/// running `cargo check` (or other compatible command) and providing
34/// diagnostics based on the output. 34/// diagnostics based on the output.
35/// The spawned thread is shut down when this struct is dropped. 35/// The spawned thread is shut down when this struct is dropped.
36#[derive(Debug)] 36#[derive(Debug)]
37pub struct CheckWatcher { 37pub struct Flycheck {
38 // XXX: drop order is significant 38 // XXX: drop order is significant
39 cmd_send: Sender<CheckCommand>, 39 cmd_send: Sender<CheckCommand>,
40 handle: Option<jod_thread::JoinHandle<()>>, 40 handle: Option<jod_thread::JoinHandle<()>>,
41 pub task_recv: Receiver<CheckTask>, 41 pub task_recv: Receiver<CheckTask>,
42} 42}
43 43
44impl CheckWatcher { 44impl Flycheck {
45 pub fn new(config: CheckConfig, workspace_root: PathBuf) -> CheckWatcher { 45 pub fn new(config: CheckConfig, workspace_root: PathBuf) -> Flycheck {
46 let (task_send, task_recv) = unbounded::<CheckTask>(); 46 let (task_send, task_recv) = unbounded::<CheckTask>();
47 let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); 47 let (cmd_send, cmd_recv) = unbounded::<CheckCommand>();
48 let handle = jod_thread::spawn(move || { 48 let handle = jod_thread::spawn(move || {
49 let mut check = CheckWatcherThread::new(config, workspace_root); 49 let mut check = FlycheckThread::new(config, workspace_root);
50 check.run(&task_send, &cmd_recv); 50 check.run(&task_send, &cmd_recv);
51 }); 51 });
52 CheckWatcher { task_recv, cmd_send, handle: Some(handle) } 52 Flycheck { task_recv, cmd_send, handle: Some(handle) }
53 } 53 }
54 54
55 /// Schedule a re-start of the cargo check worker. 55 /// Schedule a re-start of the cargo check worker.
@@ -75,7 +75,7 @@ pub enum CheckCommand {
75 Update, 75 Update,
76} 76}
77 77
78struct CheckWatcherThread { 78struct FlycheckThread {
79 options: CheckConfig, 79 options: CheckConfig,
80 workspace_root: PathBuf, 80 workspace_root: PathBuf,
81 last_update_req: Option<Instant>, 81 last_update_req: Option<Instant>,
@@ -89,9 +89,9 @@ struct CheckWatcherThread {
89 check_process: Option<jod_thread::JoinHandle<()>>, 89 check_process: Option<jod_thread::JoinHandle<()>>,
90} 90}
91 91
92impl CheckWatcherThread { 92impl FlycheckThread {
93 fn new(options: CheckConfig, workspace_root: PathBuf) -> CheckWatcherThread { 93 fn new(options: CheckConfig, workspace_root: PathBuf) -> FlycheckThread {
94 CheckWatcherThread { 94 FlycheckThread {
95 options, 95 options,
96 workspace_root, 96 workspace_root,
97 last_update_req: None, 97 last_update_req: None,