Move servers back from the background thread (#44696)

Kirill Bulatov created

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

Change summary

crates/copilot/src/copilot.rs   |  3 +--
crates/lsp/src/lsp.rs           | 32 ++++++++++++++------------------
crates/prettier/src/prettier.rs |  1 -
crates/project/src/lsp_store.rs |  1 -
4 files changed, 15 insertions(+), 22 deletions(-)

Detailed changes

crates/copilot/src/copilot.rs 🔗

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

crates/lsp/src/lsp.rs 🔗

@@ -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();