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:
@@ -516,8 +516,7 @@ impl Copilot {
|
||||
None,
|
||||
Default::default(),
|
||||
cx,
|
||||
)
|
||||
.await?;
|
||||
)?;
|
||||
|
||||
server
|
||||
.on_notification::<StatusNotification, _>(|_, _| { /* Silence the notification */ })
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -320,7 +320,6 @@ impl Prettier {
|
||||
Default::default(),
|
||||
&mut cx,
|
||||
)
|
||||
.await
|
||||
.context("prettier server creation")?;
|
||||
|
||||
let server = cx
|
||||
|
||||
@@ -425,7 +425,6 @@ impl LocalLspStore {
|
||||
Some(pending_workspace_folders),
|
||||
cx,
|
||||
)
|
||||
.await
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user