Capture language server stderr during startup/init and log if failure

This commit is contained in:
Julia 2023-10-26 12:29:22 +02:00
parent 1936ba5e30
commit 170ebd8221
8 changed files with 68 additions and 38 deletions

View file

@ -36,6 +36,7 @@ serde.workspace = true
serde_derive.workspace = true
smol.workspace = true
futures.workspace = true
parking_lot.workspace = true
[dev-dependencies]
clock = { path = "../clock" }

View file

@ -16,6 +16,7 @@ use language::{
};
use lsp::{LanguageServer, LanguageServerBinary, LanguageServerId};
use node_runtime::NodeRuntime;
use parking_lot::Mutex;
use request::StatusNotification;
use settings::SettingsStore;
use smol::{fs, io::BufReader, stream::StreamExt};
@ -387,8 +388,15 @@ impl Copilot {
path: node_path,
arguments,
};
let server =
LanguageServer::new(new_server_id, binary, Path::new("/"), None, cx.clone())?;
let server = LanguageServer::new(
Arc::new(Mutex::new(None)),
new_server_id,
binary,
Path::new("/"),
None,
cx.clone(),
)?;
server
.on_notification::<StatusNotification, _>(