chore: Move a bunch of foreground tasks into background (#35322)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-07-30 12:29:03 +02:00 committed by GitHub
parent 49b75e9e93
commit c22fa9adee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -421,14 +421,14 @@ impl LanguageServer {
.map(|stderr| { .map(|stderr| {
let io_handlers = io_handlers.clone(); let io_handlers = io_handlers.clone();
let stderr_captures = stderr_capture.clone(); let stderr_captures = stderr_capture.clone();
cx.spawn(async move |_| { cx.background_spawn(async move {
Self::handle_stderr(stderr, io_handlers, stderr_captures) Self::handle_stderr(stderr, io_handlers, stderr_captures)
.log_err() .log_err()
.await .await
}) })
}) })
.unwrap_or_else(|| Task::ready(None)); .unwrap_or_else(|| Task::ready(None));
let input_task = cx.spawn(async move |_| { let input_task = cx.background_spawn(async move {
let (stdout, stderr) = futures::join!(stdout_input_task, stderr_input_task); let (stdout, stderr) = futures::join!(stdout_input_task, stderr_input_task);
stdout.or(stderr) stdout.or(stderr)
}); });
@ -846,7 +846,7 @@ impl LanguageServer {
configuration: Arc<DidChangeConfigurationParams>, configuration: Arc<DidChangeConfigurationParams>,
cx: &App, cx: &App,
) -> Task<Result<Arc<Self>>> { ) -> Task<Result<Arc<Self>>> {
cx.spawn(async move |_| { cx.background_spawn(async move {
let response = self let response = self
.request::<request::Initialize>(params) .request::<request::Initialize>(params)
.await .await

View file

@ -424,7 +424,7 @@ impl LocalLspStore {
if settings.as_ref().is_some_and(|b| b.path.is_some()) { if settings.as_ref().is_some_and(|b| b.path.is_some()) {
let settings = settings.unwrap(); let settings = settings.unwrap();
return cx.spawn(async move |_| { return cx.background_spawn(async move {
let mut env = delegate.shell_env().await; let mut env = delegate.shell_env().await;
env.extend(settings.env.unwrap_or_default()); env.extend(settings.env.unwrap_or_default());

View file

@ -1742,7 +1742,7 @@ impl SshRemoteConnection {
} }
}); });
cx.spawn(async move |_| { cx.background_spawn(async move {
let result = futures::select! { let result = futures::select! {
result = stdin_task.fuse() => { result = stdin_task.fuse() => {
result.context("stdin") result.context("stdin")