mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
Reap proc macro server instances
This commit is contained in:
parent
c0d3e315e3
commit
7ed80bae92
3 changed files with 5 additions and 8 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1158,6 +1158,7 @@ dependencies = [
|
|||
"log",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"stdx",
|
||||
"tt",
|
||||
]
|
||||
|
||||
|
|
|
@ -18,3 +18,4 @@ jod-thread = "0.1.1"
|
|||
|
||||
tt = { path = "../tt", version = "0.0.0" }
|
||||
base_db = { path = "../base_db", version = "0.0.0" }
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
|
|
|
@ -10,6 +10,7 @@ use std::{
|
|||
};
|
||||
|
||||
use crossbeam_channel::{bounded, Receiver, Sender};
|
||||
use stdx::JodChild;
|
||||
|
||||
use crate::{
|
||||
msg::{ErrorCode, Message, Request, Response, ResponseError},
|
||||
|
@ -116,13 +117,7 @@ struct Task {
|
|||
}
|
||||
|
||||
struct Process {
|
||||
child: Child,
|
||||
}
|
||||
|
||||
impl Drop for Process {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.child.kill();
|
||||
}
|
||||
child: JodChild,
|
||||
}
|
||||
|
||||
impl Process {
|
||||
|
@ -131,7 +126,7 @@ impl Process {
|
|||
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
|
||||
) -> io::Result<Process> {
|
||||
let args: Vec<OsString> = args.into_iter().map(|s| s.as_ref().into()).collect();
|
||||
let child = mk_child(&path, &args)?;
|
||||
let child = JodChild(mk_child(&path, &args)?);
|
||||
Ok(Process { child })
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue