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

@ -2,7 +2,7 @@ use crate::{Channel, ChannelStore};
use anyhow::Result;
use client::{ChannelId, Client, Collaborator, UserStore, ZED_ALWAYS_ACTIVE};
use collections::HashMap;
use gpui::{App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Task};
use gpui::{App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Task};
use language::proto::serialize_version;
use rpc::{
proto::{self, PeerId},
@ -47,7 +47,7 @@ impl ChannelBuffer {
client: Arc<Client>,
user_store: Entity<UserStore>,
channel_store: Entity<ChannelStore>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<Entity<Self>> {
let response = client
.request(proto::JoinChannelBuffer {
@ -138,7 +138,7 @@ impl ChannelBuffer {
async fn handle_update_channel_buffer(
this: Entity<Self>,
update_channel_buffer: TypedEnvelope<proto::UpdateChannelBuffer>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
let ops = update_channel_buffer
.payload
@ -159,7 +159,7 @@ impl ChannelBuffer {
async fn handle_update_channel_buffer_collaborators(
this: Entity<Self>,
message: TypedEnvelope<proto::UpdateChannelBufferCollaborators>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
this.replace_collaborators(message.payload.collaborators, cx);

View file

@ -7,9 +7,7 @@ use client::{
};
use collections::HashSet;
use futures::lock::Mutex;
use gpui::{
App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Task, WeakEntity,
};
use gpui::{App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Task, WeakEntity};
use rand::prelude::*;
use rpc::AnyProtoClient;
use std::{
@ -108,7 +106,7 @@ impl ChannelChat {
channel_store: Entity<ChannelStore>,
user_store: Entity<UserStore>,
client: Arc<Client>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<Entity<Self>> {
let channel_id = channel.id;
let subscription = client.subscribe_to_entity(channel_id.0).unwrap();
@ -325,7 +323,7 @@ impl ChannelChat {
pub async fn load_history_since_message(
chat: Entity<Self>,
message_id: u64,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Option<usize> {
loop {
let step = chat
@ -383,7 +381,7 @@ impl ChannelChat {
rpc: Arc<Client>,
proto_messages: Vec<proto::ChannelMessage>,
loaded_all_messages: bool,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<()> {
let loaded_messages = messages_from_proto(proto_messages, &user_store, cx).await?;
@ -529,7 +527,7 @@ impl ChannelChat {
async fn handle_message_sent(
this: Entity<Self>,
message: TypedEnvelope<proto::ChannelMessageSent>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
let user_store = this.update(&mut cx, |this, _| this.user_store.clone())?;
let message = message
@ -553,7 +551,7 @@ impl ChannelChat {
async fn handle_message_removed(
this: Entity<Self>,
message: TypedEnvelope<proto::RemoveChannelMessage>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
this.message_removed(message.payload.message_id, cx)
@ -564,7 +562,7 @@ impl ChannelChat {
async fn handle_message_updated(
this: Entity<Self>,
message: TypedEnvelope<proto::ChannelMessageUpdate>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
let user_store = this.update(&mut cx, |this, _| this.user_store.clone())?;
let message = message
@ -713,7 +711,7 @@ impl ChannelChat {
async fn messages_from_proto(
proto_messages: Vec<proto::ChannelMessage>,
user_store: &Entity<UserStore>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<SumTree<ChannelMessage>> {
let messages = ChannelMessage::from_proto_vec(proto_messages, user_store, cx).await?;
let mut result = SumTree::default();
@ -725,7 +723,7 @@ impl ChannelMessage {
pub async fn from_proto(
message: proto::ChannelMessage,
user_store: &Entity<UserStore>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<Self> {
let sender = user_store
.update(cx, |user_store, cx| {
@ -770,7 +768,7 @@ impl ChannelMessage {
pub async fn from_proto_vec(
proto_messages: Vec<proto::ChannelMessage>,
user_store: &Entity<UserStore>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<Vec<Self>> {
let unique_user_ids = proto_messages
.iter()

View file

@ -7,8 +7,8 @@ use client::{ChannelId, Client, ClientSettings, Subscription, User, UserId, User
use collections::{hash_map, HashMap, HashSet};
use futures::{channel::mpsc, future::Shared, Future, FutureExt, StreamExt};
use gpui::{
App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Global, SharedString,
Task, WeakEntity,
App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Global, SharedString, Task,
WeakEntity,
};
use language::Capability;
use rpc::{
@ -458,7 +458,7 @@ impl ChannelStore {
cx: &mut Context<Self>,
) -> Task<Result<Entity<T>>>
where
F: 'static + FnOnce(Arc<Channel>, AsyncAppContext) -> Fut,
F: 'static + FnOnce(Arc<Channel>, AsyncApp) -> Fut,
Fut: Future<Output = Result<Entity<T>>>,
T: 'static,
{
@ -848,7 +848,7 @@ impl ChannelStore {
async fn handle_update_channels(
this: Entity<Self>,
message: TypedEnvelope<proto::UpdateChannels>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, _| {
this.update_channels_tx
@ -861,7 +861,7 @@ impl ChannelStore {
async fn handle_update_user_channels(
this: Entity<Self>,
message: TypedEnvelope<proto::UpdateUserChannels>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
for buffer_version in message.payload.observed_channel_buffer_version {