mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 05:53:45 +00:00
fix: Fix rust-analyzer-proc-macro-srv failing to spawn on windows
This commit is contained in:
parent
f5f7ddae23
commit
a8c94eaf13
1 changed files with 11 additions and 4 deletions
|
@ -131,12 +131,19 @@ impl Process {
|
|||
}
|
||||
|
||||
fn mk_child(path: &AbsPath, null_stderr: bool) -> io::Result<Child> {
|
||||
Command::new(path.as_os_str())
|
||||
.env("RUST_ANALYZER_INTERNALS_DO_NOT_USE", "this is unstable")
|
||||
let mut cmd = Command::new(path.as_os_str());
|
||||
cmd.env("RUST_ANALYZER_INTERNALS_DO_NOT_USE", "this is unstable")
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(if null_stderr { Stdio::null() } else { Stdio::inherit() })
|
||||
.spawn()
|
||||
.stderr(if null_stderr { Stdio::null() } else { Stdio::inherit() });
|
||||
if cfg!(windows) {
|
||||
let mut path_var = std::ffi::OsString::new();
|
||||
path_var.push(path.parent().unwrap().parent().unwrap().as_os_str());
|
||||
path_var.push("\\bin;");
|
||||
path_var.push(std::env::var_os("PATH").unwrap_or_default());
|
||||
cmd.env("PATH", path_var);
|
||||
}
|
||||
cmd.spawn()
|
||||
}
|
||||
|
||||
fn send_request(
|
||||
|
|
Loading…
Reference in a new issue