diff options
Diffstat (limited to 'crates/ra_flycheck')
-rw-r--r-- | crates/ra_flycheck/src/lib.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_flycheck/src/lib.rs b/crates/ra_flycheck/src/lib.rs index 0e2ee8698..6751e5c38 100644 --- a/crates/ra_flycheck/src/lib.rs +++ b/crates/ra_flycheck/src/lib.rs | |||
@@ -48,21 +48,21 @@ impl fmt::Display for FlycheckConfig { | |||
48 | /// diagnostics based on the output. | 48 | /// diagnostics based on the output. |
49 | /// The spawned thread is shut down when this struct is dropped. | 49 | /// The spawned thread is shut down when this struct is dropped. |
50 | #[derive(Debug)] | 50 | #[derive(Debug)] |
51 | pub struct Flycheck { | 51 | pub struct FlycheckHandle { |
52 | // XXX: drop order is significant | 52 | // XXX: drop order is significant |
53 | cmd_send: Sender<CheckCommand>, | 53 | cmd_send: Sender<CheckCommand>, |
54 | handle: jod_thread::JoinHandle<()>, | 54 | handle: jod_thread::JoinHandle<()>, |
55 | pub task_recv: Receiver<CheckTask>, | 55 | pub task_recv: Receiver<CheckTask>, |
56 | } | 56 | } |
57 | 57 | ||
58 | impl Flycheck { | 58 | impl FlycheckHandle { |
59 | pub fn new(config: FlycheckConfig, workspace_root: PathBuf) -> Flycheck { | 59 | pub fn spawn(config: FlycheckConfig, workspace_root: PathBuf) -> FlycheckHandle { |
60 | let (task_send, task_recv) = unbounded::<CheckTask>(); | 60 | let (task_send, task_recv) = unbounded::<CheckTask>(); |
61 | let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); | 61 | let (cmd_send, cmd_recv) = unbounded::<CheckCommand>(); |
62 | let handle = jod_thread::spawn(move || { | 62 | let handle = jod_thread::spawn(move || { |
63 | FlycheckThread::new(config, workspace_root).run(&task_send, &cmd_recv); | 63 | FlycheckActor::new(config, workspace_root).run(&task_send, &cmd_recv); |
64 | }); | 64 | }); |
65 | Flycheck { task_recv, cmd_send, handle } | 65 | FlycheckHandle { task_recv, cmd_send, handle } |
66 | } | 66 | } |
67 | 67 | ||
68 | /// Schedule a re-start of the cargo check worker. | 68 | /// Schedule a re-start of the cargo check worker. |
@@ -95,7 +95,7 @@ pub enum CheckCommand { | |||
95 | Update, | 95 | Update, |
96 | } | 96 | } |
97 | 97 | ||
98 | struct FlycheckThread { | 98 | struct FlycheckActor { |
99 | config: FlycheckConfig, | 99 | config: FlycheckConfig, |
100 | workspace_root: PathBuf, | 100 | workspace_root: PathBuf, |
101 | last_update_req: Option<Instant>, | 101 | last_update_req: Option<Instant>, |
@@ -109,9 +109,9 @@ struct FlycheckThread { | |||
109 | check_process: Option<jod_thread::JoinHandle<()>>, | 109 | check_process: Option<jod_thread::JoinHandle<()>>, |
110 | } | 110 | } |
111 | 111 | ||
112 | impl FlycheckThread { | 112 | impl FlycheckActor { |
113 | fn new(config: FlycheckConfig, workspace_root: PathBuf) -> FlycheckThread { | 113 | fn new(config: FlycheckConfig, workspace_root: PathBuf) -> FlycheckActor { |
114 | FlycheckThread { | 114 | FlycheckActor { |
115 | config, | 115 | config, |
116 | workspace_root, | 116 | workspace_root, |
117 | last_update_req: None, | 117 | last_update_req: None, |