Skip to content

chore: make lsp server spawning error more helpful by attachging a ctx #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn run_app_forever(client_reader: impl std::io::Read + Send + 'static,
client_writer: impl std::io::Write + Send + 'static,
mut server_cmd: std::process::Command,
options: AppOptions) -> Result<std::process::ExitStatus> {
info!("Running server {:?}", server_cmd);
info!("About to run the lsp server with command {:?}", server_cmd);
if let Some(ref bytecode_options) = options.bytecode_options {
info!("Will convert server json to bytecode! bytecode options: {:?}", bytecode_options);
} else {
Expand All @@ -111,7 +111,13 @@ pub fn run_app_forever(client_reader: impl std::io::Read + Send + 'static,
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::inherit())
.spawn()?;
.spawn()
.with_context(|| {
format!(
"Failed to run the lsp server with command: {:?}",
server_cmd
)
})?;

let (c2s_channel_pub, c2s_channel_sub) = mpsc::channel::<String>();
let c2s_channel_counter = Arc::new(AtomicI32::new(0));
Expand Down