Register initial request handlers before launching server

This commit is contained in:
Julia 2023-08-16 21:25:17 -04:00
parent 8839b07a25
commit e54f16f372
2 changed files with 6 additions and 6 deletions

View file

@ -282,7 +282,7 @@ impl LanguageServer {
stdout.read_exact(&mut buffer).await?;
if let Ok(message) = str::from_utf8(&buffer) {
log::trace!("incoming message:{}", message);
log::trace!("incoming message: {}", message);
for handler in io_handlers.lock().values_mut() {
handler(true, message);
}

View file

@ -2748,10 +2748,8 @@ impl Project {
) -> Result<Option<Arc<LanguageServer>>> {
let workspace_config = cx.update(|cx| languages.workspace_configuration(cx)).await;
let language_server = match pending_server.task.await? {
Some(server) => server.initialize(initialization_options).await?,
None => {
return Ok(None);
}
Some(server) => server,
None => return Ok(None),
};
language_server
@ -2909,7 +2907,9 @@ impl Project {
)
.ok();
Ok(Some(language_server))
Ok(Some(
language_server.initialize(initialization_options).await?,
))
}
fn insert_newly_running_language_server(