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

@ -48,8 +48,8 @@ use ::git::{
status::FileStatus,
};
use gpui::{
AnyEntity, App, AppContext as _, AsyncAppContext, BorrowAppContext, Context, Entity,
EventEmitter, Hsla, SharedString, Task, WeakEntity, Window,
AnyEntity, App, AppContext as _, AsyncApp, BorrowAppContext, Context, Entity, EventEmitter,
Hsla, SharedString, Task, WeakEntity, Window,
};
use itertools::Itertools;
use language::{
@ -898,7 +898,7 @@ impl Project {
user_store: Entity<UserStore>,
languages: Arc<LanguageRegistry>,
fs: Arc<dyn Fs>,
cx: AsyncAppContext,
cx: AsyncApp,
) -> Result<Entity<Self>> {
let project =
Self::in_room(remote_id, client, user_store, languages, fs, cx.clone()).await?;
@ -916,7 +916,7 @@ impl Project {
user_store: Entity<UserStore>,
languages: Arc<LanguageRegistry>,
fs: Arc<dyn Fs>,
cx: AsyncAppContext,
cx: AsyncApp,
) -> Result<Entity<Self>> {
client.authenticate_and_connect(true, &cx).await?;
@ -958,7 +958,7 @@ impl Project {
user_store: Entity<UserStore>,
languages: Arc<LanguageRegistry>,
fs: Arc<dyn Fs>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<Entity<Self>> {
let remote_id = response.payload.project_id;
let role = response.payload.role();
@ -1156,7 +1156,7 @@ impl Project {
#[cfg(any(test, feature = "test-support"))]
pub async fn example(
root_paths: impl IntoIterator<Item = &Path>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Entity<Project> {
use clock::FakeSystemClock;
@ -2018,7 +2018,7 @@ impl Project {
async fn send_buffer_ordered_messages(
this: WeakEntity<Self>,
rx: UnboundedReceiver<BufferOrderedMessage>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
const MAX_BATCH_SIZE: usize = 128;
@ -2028,7 +2028,7 @@ impl Project {
operations_by_buffer_id: &mut HashMap<BufferId, Vec<proto::Operation>>,
needs_resync_with_host: &mut bool,
is_local: bool,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<()> {
for (buffer_id, operations) in operations_by_buffer_id.drain() {
let request = this.update(cx, |this, _| {
@ -3541,7 +3541,7 @@ impl Project {
async fn handle_unshare_project(
this: Entity<Self>,
_: TypedEnvelope<proto::UnshareProject>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
if this.is_local() || this.is_via_ssh() {
@ -3556,7 +3556,7 @@ impl Project {
async fn handle_add_collaborator(
this: Entity<Self>,
mut envelope: TypedEnvelope<proto::AddProjectCollaborator>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
let collaborator = envelope
.payload
@ -3581,7 +3581,7 @@ impl Project {
async fn handle_update_project_collaborator(
this: Entity<Self>,
envelope: TypedEnvelope<proto::UpdateProjectCollaborator>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
let old_peer_id = envelope
.payload
@ -3624,7 +3624,7 @@ impl Project {
async fn handle_remove_collaborator(
this: Entity<Self>,
envelope: TypedEnvelope<proto::RemoveProjectCollaborator>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
let peer_id = envelope
@ -3652,7 +3652,7 @@ impl Project {
async fn handle_update_project(
this: Entity<Self>,
envelope: TypedEnvelope<proto::UpdateProject>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
// Don't handle messages that were sent before the response to us joining the project
@ -3666,7 +3666,7 @@ impl Project {
async fn handle_toast(
this: Entity<Self>,
envelope: TypedEnvelope<proto::Toast>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |_, cx| {
cx.emit(Event::Toast {
@ -3680,7 +3680,7 @@ impl Project {
async fn handle_language_server_prompt_request(
this: Entity<Self>,
envelope: TypedEnvelope<proto::LanguageServerPromptRequest>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::LanguageServerPromptResponse> {
let (tx, mut rx) = smol::channel::bounded(1);
let actions: Vec<_> = envelope
@ -3727,7 +3727,7 @@ impl Project {
async fn handle_hide_toast(
this: Entity<Self>,
envelope: TypedEnvelope<proto::HideToast>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |_, cx| {
cx.emit(Event::HideToast {
@ -3741,7 +3741,7 @@ impl Project {
async fn handle_update_worktree(
this: Entity<Self>,
envelope: TypedEnvelope<proto::UpdateWorktree>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
let worktree_id = WorktreeId::from_proto(envelope.payload.worktree_id);
@ -3758,7 +3758,7 @@ impl Project {
async fn handle_update_buffer_from_ssh(
this: Entity<Self>,
envelope: TypedEnvelope<proto::UpdateBuffer>,
cx: AsyncAppContext,
cx: AsyncApp,
) -> Result<proto::Ack> {
let buffer_store = this.read_with(&cx, |this, cx| {
if let Some(remote_id) = this.remote_id() {
@ -3776,7 +3776,7 @@ impl Project {
async fn handle_update_buffer(
this: Entity<Self>,
envelope: TypedEnvelope<proto::UpdateBuffer>,
cx: AsyncAppContext,
cx: AsyncApp,
) -> Result<proto::Ack> {
let buffer_store = this.read_with(&cx, |this, cx| {
if let Some(ssh) = &this.ssh_client {
@ -3812,7 +3812,7 @@ impl Project {
async fn handle_create_buffer_for_peer(
this: Entity<Self>,
envelope: TypedEnvelope<proto::CreateBufferForPeer>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<()> {
this.update(&mut cx, |this, cx| {
this.buffer_store.update(cx, |buffer_store, cx| {
@ -3829,7 +3829,7 @@ impl Project {
async fn handle_synchronize_buffers(
this: Entity<Self>,
envelope: TypedEnvelope<proto::SynchronizeBuffers>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::SynchronizeBuffersResponse> {
let response = this.update(&mut cx, |this, cx| {
let client = this.client.clone();
@ -3844,7 +3844,7 @@ impl Project {
async fn handle_search_candidate_buffers(
this: Entity<Self>,
envelope: TypedEnvelope<proto::FindSearchCandidates>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::FindSearchCandidatesResponse> {
let peer_id = envelope.original_sender_id()?;
let message = envelope.payload;
@ -3874,7 +3874,7 @@ impl Project {
async fn handle_open_buffer_by_id(
this: Entity<Self>,
envelope: TypedEnvelope<proto::OpenBufferById>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::OpenBufferResponse> {
let peer_id = envelope.original_sender_id()?;
let buffer_id = BufferId::new(envelope.payload.id)?;
@ -3887,7 +3887,7 @@ impl Project {
async fn handle_open_buffer_by_path(
this: Entity<Self>,
envelope: TypedEnvelope<proto::OpenBufferByPath>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::OpenBufferResponse> {
let peer_id = envelope.original_sender_id()?;
let worktree_id = WorktreeId::from_proto(envelope.payload.worktree_id);
@ -3908,7 +3908,7 @@ impl Project {
async fn handle_open_new_buffer(
this: Entity<Self>,
envelope: TypedEnvelope<proto::OpenNewBuffer>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::OpenBufferResponse> {
let buffer = this
.update(&mut cx, |this, cx| this.create_buffer(cx))?
@ -3922,7 +3922,7 @@ impl Project {
this: Entity<Self>,
buffer: Entity<Buffer>,
peer_id: proto::PeerId,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<proto::OpenBufferResponse> {
this.update(cx, |this, cx| {
let is_private = buffer