lsp: More information in error if server fails to start (#11343)
We do log that information, but we don't put it in the error message where it's really useful. Release Notes: - N/A
This commit is contained in:
parent
f987ff05fd
commit
9348e6f7fb
1 changed files with 7 additions and 2 deletions
|
@ -262,7 +262,7 @@ impl LanguageServer {
|
||||||
let mut command = process::Command::new(&binary.path);
|
let mut command = process::Command::new(&binary.path);
|
||||||
command
|
command
|
||||||
.current_dir(working_dir)
|
.current_dir(working_dir)
|
||||||
.args(binary.arguments)
|
.args(&binary.arguments)
|
||||||
.envs(binary.env.unwrap_or_default())
|
.envs(binary.env.unwrap_or_default())
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
|
@ -270,7 +270,12 @@ impl LanguageServer {
|
||||||
.kill_on_drop(true);
|
.kill_on_drop(true);
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
command.creation_flags(windows::Win32::System::Threading::CREATE_NO_WINDOW.0);
|
command.creation_flags(windows::Win32::System::Threading::CREATE_NO_WINDOW.0);
|
||||||
let mut server = command.spawn()?;
|
let mut server = command.spawn().with_context(|| {
|
||||||
|
format!(
|
||||||
|
"failed to spawn command. path: {:?}, working directory: {:?}, args: {:?}",
|
||||||
|
binary.path, working_dir, &binary.arguments
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
let stdin = server.stdin.take().unwrap();
|
let stdin = server.stdin.take().unwrap();
|
||||||
let stdout = server.stdout.take().unwrap();
|
let stdout = server.stdout.take().unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue