Fix missed renames in #22632 (#23688)

Fix a bug where a GPUI macro still used `ModelContext`
Rename `AsyncAppContext` -> `AsyncApp`
Rename update_model, read_model, insert_model, and reserve_model to
update_entity, read_entity, insert_entity, and reserve_entity

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-01-26 15:37:34 -08:00 committed by GitHub
parent 83141d07e9
commit a6b1514246
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
118 changed files with 708 additions and 757 deletions

View file

@ -32,11 +32,11 @@ use futures::{
};
use gpui::{
action_as, actions, canvas, impl_action_as, impl_actions, point, relative, size,
transparent_black, Action, AnyView, AnyWeakView, App, AsyncAppContext, AsyncWindowContext,
Bounds, Context, CursorStyle, Decorations, DragMoveEvent, Entity, EntityId, EventEmitter,
FocusHandle, Focusable, Global, Hsla, KeyContext, Keystroke, ManagedView, MouseButton,
PathPromptOptions, Point, PromptLevel, Render, ResizeEdge, Size, Stateful, Subscription, Task,
Tiling, WeakEntity, WindowBounds, WindowHandle, WindowId, WindowOptions,
transparent_black, Action, AnyView, AnyWeakView, App, AsyncApp, AsyncWindowContext, Bounds,
Context, CursorStyle, Decorations, DragMoveEvent, Entity, EntityId, EventEmitter, FocusHandle,
Focusable, Global, Hsla, KeyContext, Keystroke, ManagedView, MouseButton, PathPromptOptions,
Point, PromptLevel, Render, ResizeEdge, Size, Stateful, Subscription, Task, Tiling, WeakEntity,
WindowBounds, WindowHandle, WindowId, WindowOptions,
};
pub use item::{
FollowableItem, FollowableItemHandle, Item, ItemHandle, ItemSettings, PreviewTabsSettings,
@ -5160,7 +5160,7 @@ enum ActivateInDirectionTarget {
Dock(Entity<Dock>),
}
fn notify_if_database_failed(workspace: WindowHandle<Workspace>, cx: &mut AsyncAppContext) {
fn notify_if_database_failed(workspace: WindowHandle<Workspace>, cx: &mut AsyncApp) {
const REPORT_ISSUE_URL: &str = "https://github.com/zed-industries/zed/issues/new?assignees=&labels=admin+read%2Ctriage%2Cbug&projects=&template=1_bug_report.yml";
workspace
@ -5504,7 +5504,7 @@ impl WorkspaceStore {
pub async fn handle_follow(
this: Entity<Self>,
envelope: TypedEnvelope<proto::Follow>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::FollowResponse> {
this.update(&mut cx, |this, cx| {
let follower = Follower {
@ -5534,7 +5534,7 @@ impl WorkspaceStore {
async fn handle_update_followers(
this: Entity<Self>,
envelope: TypedEnvelope<proto::UpdateFollowers>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
let leader_id = envelope.original_sender_id()?;
let update = envelope.payload;
@ -5657,7 +5657,7 @@ async fn join_channel_internal(
app_state: &Arc<AppState>,
requesting_window: Option<WindowHandle<Workspace>>,
active_call: &Entity<ActiveCall>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<bool> {
let (should_prompt, open_room) = active_call.update(cx, |active_call, cx| {
let Some(room) = active_call.room().map(|room| room.read(cx)) else {
@ -5877,7 +5877,7 @@ pub fn join_channel(
pub async fn get_any_active_workspace(
app_state: Arc<AppState>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> anyhow::Result<WindowHandle<Workspace>> {
// find an existing workspace to focus and show call controls
let active_window = activate_any_workspace_window(&mut cx);
@ -5888,7 +5888,7 @@ pub async fn get_any_active_workspace(
activate_any_workspace_window(&mut cx).context("could not open zed")
}
fn activate_any_workspace_window(cx: &mut AsyncAppContext) -> Option<WindowHandle<Workspace>> {
fn activate_any_workspace_window(cx: &mut AsyncApp) -> Option<WindowHandle<Workspace>> {
cx.update(|cx| {
if let Some(workspace_window) = cx
.active_window()
@ -6185,7 +6185,7 @@ pub fn open_ssh_project(
fn serialize_ssh_project(
connection_options: SshConnectionOptions,
paths: Vec<PathBuf>,
cx: &AsyncAppContext,
cx: &AsyncApp,
) -> Task<
Result<(
SerializedSshProject,
@ -6755,7 +6755,7 @@ mod tests {
// Adding an item that creates ambiguity increases the level of detail on
// both tabs.
let item2 = cx.new_window_model(|_window, cx| {
let item2 = cx.new_window_entity(|_window, cx| {
let mut item = TestItem::new(cx);
item.tab_descriptions = Some(vec!["c", "b2/c", "a/b2/c"]);
item