feat: Only flycheck workspace that belongs to saved file

This commit is contained in:
Lukas Wirth 2022-07-18 20:30:07 +02:00
parent ea416175d5
commit a63b5d3c84
3 changed files with 70 additions and 7 deletions

View file

@ -55,6 +55,7 @@ pub struct FlycheckHandle {
// XXX: drop order is significant
sender: Sender<Restart>,
_thread: jod_thread::JoinHandle,
id: usize,
}
impl FlycheckHandle {
@ -70,13 +71,17 @@ impl FlycheckHandle {
.name("Flycheck".to_owned())
.spawn(move || actor.run(receiver))
.expect("failed to spawn thread");
FlycheckHandle { sender, _thread: thread }
FlycheckHandle { id, sender, _thread: thread }
}
/// Schedule a re-start of the cargo check worker.
pub fn update(&self) {
self.sender.send(Restart).unwrap();
}
pub fn id(&self) -> usize {
self.id
}
}
pub enum Message {