cx.background_executor().spawn(...) -> cx.background_spawn(...) (#25103)

Done automatically with

> ast-grep -p '$A.background_executor().spawn($B)' -r
'$A.background_spawn($B)' --update-all --globs "\!crates/gpui"

Followed by:

* `cargo fmt`
* Unexpected need to remove some trailing whitespace.
* Manually adding imports of `gpui::{AppContext as _}` which provides
`background_spawn`
* Added `AppContext as _` to existing use of `AppContext`

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2025-02-18 20:30:33 +00:00
committed by GitHub
parent f606b0641e
commit b1872e3afd
120 changed files with 1146 additions and 1267 deletions
+4 -4
View File
@@ -5,7 +5,7 @@ use futures::{
stream::{SelectAll, StreamExt},
AsyncBufReadExt as _, SinkExt as _,
};
use gpui::{App, Entity, EntityId, Task, Window};
use gpui::{App, AppContext as _, Entity, EntityId, Task, Window};
use jupyter_protocol::{
connection_info::{ConnectionInfo, Transport},
ExecutionState, JupyterKernelspec, JupyterMessage, JupyterMessageContent, KernelInfoReply,
@@ -211,7 +211,7 @@ impl NativeRunningKernel {
futures::channel::mpsc::channel(100);
let (mut shell_request_tx, mut shell_request_rx) = futures::channel::mpsc::channel(100);
let routing_task = cx.background_executor().spawn({
let routing_task = cx.background_spawn({
async move {
while let Some(message) = request_rx.next().await {
match message.content {
@@ -229,7 +229,7 @@ impl NativeRunningKernel {
}
});
let shell_task = cx.background_executor().spawn({
let shell_task = cx.background_spawn({
async move {
while let Some(message) = shell_request_rx.next().await {
shell_socket.send(message).await.ok();
@@ -240,7 +240,7 @@ impl NativeRunningKernel {
}
});
let control_task = cx.background_executor().spawn({
let control_task = cx.background_spawn({
async move {
while let Some(message) = control_request_rx.next().await {
control_socket.send(message).await.ok();
+2 -2
View File
@@ -1,5 +1,5 @@
use futures::{channel::mpsc, SinkExt as _};
use gpui::{App, Entity, Task, Window};
use gpui::{App, AppContext as _, Entity, Task, Window};
use http_client::{AsyncBody, HttpClient, Request};
use jupyter_protocol::{ExecutionState, JupyterKernelspec, JupyterMessage, KernelInfoReply};
@@ -189,7 +189,7 @@ impl RemoteRunningKernel {
let (request_tx, mut request_rx) =
futures::channel::mpsc::channel::<JupyterMessage>(100);
let routing_task = cx.background_executor().spawn({
let routing_task = cx.background_spawn({
async move {
while let Some(message) = request_rx.next().await {
w.send(message).await.ok();