Move servers back from the background thread (#44696)

Partial revert of https://github.com/zed-industries/zed/pull/44631

With this and `sccache` enabled, I get 
<img width="3456" height="1096" alt="image"
src="https://github.com/user-attachments/assets/937760fb-8b53-49f8-ae63-4df1d31b292b"
/>

and r-a infinitely hangs waiting on this.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov
2025-12-12 13:16:17 +02:00
committed by GitHub
parent a8aa7622b7
commit 1afe29422b
4 changed files with 15 additions and 22 deletions

View File

@@ -516,8 +516,7 @@ impl Copilot {
None,
Default::default(),
cx,
)
.await?;
)?;
server
.on_notification::<StatusNotification, _>(|_, _| { /* Silence the notification */ })

View File

@@ -314,7 +314,7 @@ pub struct AdapterServerCapabilities {
impl LanguageServer {
/// Starts a language server process.
pub async fn new(
pub fn new(
stderr_capture: Arc<Mutex<Option<String>>>,
server_id: LanguageServerId,
server_name: LanguageServerName,
@@ -338,23 +338,19 @@ impl LanguageServer {
working_dir,
&binary.arguments
);
let mut server = cx
.background_executor()
.await_on_background(async {
let mut command = util::command::new_smol_command(&binary.path);
command
.current_dir(working_dir)
.args(&binary.arguments)
.envs(binary.env.clone().unwrap_or_default())
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.kill_on_drop(true);
command
.spawn()
.with_context(|| format!("failed to spawn command {command:?}",))
})
.await?;
let mut command = util::command::new_smol_command(&binary.path);
command
.current_dir(working_dir)
.args(&binary.arguments)
.envs(binary.env.clone().unwrap_or_default())
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.kill_on_drop(true);
let mut server = command
.spawn()
.with_context(|| format!("failed to spawn command {command:?}",))?;
let stdin = server.stdin.take().unwrap();
let stdout = server.stdout.take().unwrap();

View File

@@ -320,7 +320,6 @@ impl Prettier {
Default::default(),
&mut cx,
)
.await
.context("prettier server creation")?;
let server = cx

View File

@@ -425,7 +425,6 @@ impl LocalLspStore {
Some(pending_workspace_folders),
cx,
)
.await
}
});