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 13:30:33 -07:00
committed by GitHub
parent f606b0641e
commit b1872e3afd
120 changed files with 1146 additions and 1267 deletions
+5 -6
View File
@@ -1,7 +1,7 @@
use collections::{HashMap, HashSet};
use git::diff::DiffHunkStatus;
use gpui::{
Action, AppContext, Corner, CursorStyle, Focusable as _, Hsla, Model, MouseButton,
Action, AppContext as _, Corner, CursorStyle, Focusable as _, Hsla, Model, MouseButton,
Subscription, Task,
};
use language::{Buffer, BufferId, Point};
@@ -372,7 +372,7 @@ impl Editor {
self.diff_map
.hunk_update_tasks
.insert(None, cx.background_executor().spawn(new_toggle_task));
.insert(None, cx.background_spawn(new_toggle_task));
}
pub(super) fn expand_diff_hunk(
@@ -1089,10 +1089,9 @@ impl Editor {
.ok();
});
diff_map.hunk_update_tasks.insert(
Some(buffer_id),
cx.background_executor().spawn(new_sync_task),
);
diff_map
.hunk_update_tasks
.insert(Some(buffer_id), cx.background_spawn(new_sync_task));
}
fn go_to_subsequent_hunk(