diff options
Diffstat (limited to 'crates/ra_flycheck/src')
-rw-r--r-- | crates/ra_flycheck/src/lib.rs | 20 |
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)] |
37 | pub struct CheckWatcher { | 37 | pub 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 | ||
44 | impl CheckWatcher { | 44 | impl 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 | ||
78 | struct CheckWatcherThread { | 78 | struct 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 | ||
92 | impl CheckWatcherThread { | 92 | impl 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, |