Skip to content

Commit bd35010

Browse files
committed
Fix restart missing arguments in proc-macro-srv
1 parent 0ad6b6d commit bd35010

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

crates/ra_proc_macro/src/process.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::rpc::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTas
99
use io::{BufRead, BufReader};
1010
use std::{
1111
convert::{TryFrom, TryInto},
12-
ffi::OsStr,
12+
ffi::{OsStr, OsString},
1313
io::{self, Write},
1414
path::{Path, PathBuf},
1515
process::{Child, Command, Stdio},
@@ -35,6 +35,7 @@ struct Task {
3535

3636
struct Process {
3737
path: PathBuf,
38+
args: Vec<OsString>,
3839
child: Child,
3940
}
4041

@@ -46,22 +47,25 @@ impl Drop for Process {
4647

4748
impl Process {
4849
fn run(
49-
process_path: PathBuf,
50+
path: PathBuf,
5051
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
5152
) -> io::Result<Process> {
52-
let child = Command::new(&process_path)
53-
.args(args)
53+
let args = args.into_iter().map(|s| s.as_ref().into()).collect();
54+
55+
let child = Command::new(&path)
56+
.args(&args)
5457
.stdin(Stdio::piped())
5558
.stdout(Stdio::piped())
5659
.stderr(Stdio::null())
5760
.spawn()?;
5861

59-
Ok(Process { path: process_path, child })
62+
Ok(Process { path, args, child })
6063
}
6164

6265
fn restart(&mut self) -> io::Result<()> {
6366
let _ = self.child.kill();
6467
self.child = Command::new(&self.path)
68+
.args(&self.args)
6569
.stdin(Stdio::piped())
6670
.stdout(Stdio::piped())
6771
.stderr(Stdio::null())

0 commit comments

Comments
 (0)