Auto merge of #16312 - Veykril:win-proc-macro-srv, r=Veykril
fix: Fix rust-analyzer-proc-macro-srv failing to spawn on windows
This commit is contained in:
commit
e3575a87de
@ -162,12 +162,19 @@ impl Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn mk_child(path: &AbsPath, null_stderr: bool) -> io::Result<Child> {
|
fn mk_child(path: &AbsPath, null_stderr: bool) -> io::Result<Child> {
|
||||||
Command::new(path.as_os_str())
|
let mut cmd = Command::new(path.as_os_str());
|
||||||
.env("RUST_ANALYZER_INTERNALS_DO_NOT_USE", "this is unstable")
|
cmd.env("RUST_ANALYZER_INTERNALS_DO_NOT_USE", "this is unstable")
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.stderr(if null_stderr { Stdio::null() } else { Stdio::inherit() })
|
.stderr(if null_stderr { Stdio::null() } else { Stdio::inherit() });
|
||||||
.spawn()
|
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(
|
fn send_request(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user