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:
parent
83141d07e9
commit
a6b1514246
118 changed files with 708 additions and 757 deletions
|
@ -8,8 +8,8 @@ use client::{proto, ChannelId, Client, TypedEnvelope, User, UserStore, ZED_ALWAY
|
|||
use collections::HashSet;
|
||||
use futures::{channel::oneshot, future::Shared, Future, FutureExt};
|
||||
use gpui::{
|
||||
App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Global, Subscription,
|
||||
Task, WeakEntity,
|
||||
App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Global, Subscription, Task,
|
||||
WeakEntity,
|
||||
};
|
||||
use postage::watch;
|
||||
use project::Project;
|
||||
|
@ -48,7 +48,7 @@ impl OneAtATime {
|
|||
/// otherwise you'll see the result of the task.
|
||||
fn spawn<F, Fut, R>(&mut self, cx: &mut App, f: F) -> Task<Result<Option<R>>>
|
||||
where
|
||||
F: 'static + FnOnce(AsyncAppContext) -> Fut,
|
||||
F: 'static + FnOnce(AsyncApp) -> Fut,
|
||||
Fut: Future<Output = Result<R>>,
|
||||
R: 'static,
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ impl ActiveCall {
|
|||
async fn handle_incoming_call(
|
||||
this: Entity<Self>,
|
||||
envelope: TypedEnvelope<proto::IncomingCall>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<proto::Ack> {
|
||||
let user_store = this.update(&mut cx, |this, _| this.user_store.clone())?;
|
||||
let call = IncomingCall {
|
||||
|
@ -147,7 +147,7 @@ impl ActiveCall {
|
|||
async fn handle_call_canceled(
|
||||
this: Entity<Self>,
|
||||
envelope: TypedEnvelope<proto::CallCanceled>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
this.update(&mut cx, |this, _| {
|
||||
let mut incoming_call = this.incoming_call.0.borrow_mut();
|
||||
|
|
|
@ -13,7 +13,7 @@ use client::{
|
|||
use collections::{BTreeMap, HashMap, HashSet};
|
||||
use fs::Fs;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use gpui::{App, AppContext, AsyncAppContext, Context, Entity, EventEmitter, Task, WeakEntity};
|
||||
use gpui::{App, AppContext, AsyncApp, Context, Entity, EventEmitter, Task, WeakEntity};
|
||||
use language::LanguageRegistry;
|
||||
#[cfg(not(all(target_os = "windows", target_env = "gnu")))]
|
||||
use livekit::{
|
||||
|
@ -218,7 +218,7 @@ impl Room {
|
|||
channel_id: ChannelId,
|
||||
client: Arc<Client>,
|
||||
user_store: Entity<UserStore>,
|
||||
cx: AsyncAppContext,
|
||||
cx: AsyncApp,
|
||||
) -> Result<Entity<Self>> {
|
||||
Self::from_join_response(
|
||||
client
|
||||
|
@ -236,7 +236,7 @@ impl Room {
|
|||
room_id: u64,
|
||||
client: Arc<Client>,
|
||||
user_store: Entity<UserStore>,
|
||||
cx: AsyncAppContext,
|
||||
cx: AsyncApp,
|
||||
) -> Result<Entity<Self>> {
|
||||
Self::from_join_response(
|
||||
client.request(proto::JoinRoom { id: room_id }).await?,
|
||||
|
@ -277,7 +277,7 @@ impl Room {
|
|||
response: proto::JoinRoomResponse,
|
||||
client: Arc<Client>,
|
||||
user_store: Entity<UserStore>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<Entity<Self>> {
|
||||
let room_proto = response.room.ok_or_else(|| anyhow!("invalid room"))?;
|
||||
let room = cx.new(|cx| {
|
||||
|
@ -358,7 +358,7 @@ impl Room {
|
|||
async fn maintain_connection(
|
||||
this: WeakEntity<Self>,
|
||||
client: Arc<Client>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
let mut client_status = client.status();
|
||||
loop {
|
||||
|
@ -639,7 +639,7 @@ impl Room {
|
|||
async fn handle_room_updated(
|
||||
this: Entity<Self>,
|
||||
envelope: TypedEnvelope<proto::RoomUpdated>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
let room = envelope
|
||||
.payload
|
||||
|
@ -1318,7 +1318,7 @@ impl Room {
|
|||
}
|
||||
|
||||
#[cfg(all(target_os = "windows", target_env = "gnu"))]
|
||||
pub fn share_microphone(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
|
||||
pub fn share_microphone(&mut self, cx: &mut Context<Self>) -> Task<Result<()>> {
|
||||
Task::ready(Err(anyhow!("MinGW is not supported yet")))
|
||||
}
|
||||
|
||||
|
@ -1626,7 +1626,7 @@ impl Room {
|
|||
#[cfg(all(target_os = "windows", target_env = "gnu"))]
|
||||
fn spawn_room_connection(
|
||||
livekit_connection_info: Option<proto::LiveKitConnectionInfo>,
|
||||
cx: &mut ModelContext<'_, Room>,
|
||||
cx: &mut Context<'_, Room>,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ use client::{proto, ChannelId, Client, TypedEnvelope, User, UserStore, ZED_ALWAY
|
|||
use collections::HashSet;
|
||||
use futures::{channel::oneshot, future::Shared, Future, FutureExt};
|
||||
use gpui::{
|
||||
App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Global, Subscription,
|
||||
Task, WeakEntity,
|
||||
App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Global, Subscription, Task,
|
||||
WeakEntity,
|
||||
};
|
||||
use postage::watch;
|
||||
use project::Project;
|
||||
|
@ -41,7 +41,7 @@ impl OneAtATime {
|
|||
/// otherwise you'll see the result of the task.
|
||||
fn spawn<F, Fut, R>(&mut self, cx: &mut App, f: F) -> Task<Result<Option<R>>>
|
||||
where
|
||||
F: 'static + FnOnce(AsyncAppContext) -> Fut,
|
||||
F: 'static + FnOnce(AsyncApp) -> Fut,
|
||||
Fut: Future<Output = Result<R>>,
|
||||
R: 'static,
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ impl ActiveCall {
|
|||
async fn handle_incoming_call(
|
||||
this: Entity<Self>,
|
||||
envelope: TypedEnvelope<proto::IncomingCall>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<proto::Ack> {
|
||||
let user_store = this.update(&mut cx, |this, _| this.user_store.clone())?;
|
||||
let call = IncomingCall {
|
||||
|
@ -140,7 +140,7 @@ impl ActiveCall {
|
|||
async fn handle_call_canceled(
|
||||
this: Entity<Self>,
|
||||
envelope: TypedEnvelope<proto::CallCanceled>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
this.update(&mut cx, |this, _| {
|
||||
let mut incoming_call = this.incoming_call.0.borrow_mut();
|
||||
|
|
|
@ -11,9 +11,7 @@ use client::{
|
|||
use collections::{BTreeMap, HashMap, HashSet};
|
||||
use fs::Fs;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use gpui::{
|
||||
App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Task, WeakEntity,
|
||||
};
|
||||
use gpui::{App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Task, WeakEntity};
|
||||
use language::LanguageRegistry;
|
||||
use livekit_client_macos::{LocalAudioTrack, LocalTrackPublication, LocalVideoTrack, RoomUpdate};
|
||||
use postage::{sink::Sink, stream::Stream, watch};
|
||||
|
@ -276,7 +274,7 @@ impl Room {
|
|||
channel_id: ChannelId,
|
||||
client: Arc<Client>,
|
||||
user_store: Entity<UserStore>,
|
||||
cx: AsyncAppContext,
|
||||
cx: AsyncApp,
|
||||
) -> Result<Entity<Self>> {
|
||||
Self::from_join_response(
|
||||
client
|
||||
|
@ -294,7 +292,7 @@ impl Room {
|
|||
room_id: u64,
|
||||
client: Arc<Client>,
|
||||
user_store: Entity<UserStore>,
|
||||
cx: AsyncAppContext,
|
||||
cx: AsyncApp,
|
||||
) -> Result<Entity<Self>> {
|
||||
Self::from_join_response(
|
||||
client.request(proto::JoinRoom { id: room_id }).await?,
|
||||
|
@ -335,7 +333,7 @@ impl Room {
|
|||
response: proto::JoinRoomResponse,
|
||||
client: Arc<Client>,
|
||||
user_store: Entity<UserStore>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<Entity<Self>> {
|
||||
let room_proto = response.room.ok_or_else(|| anyhow!("invalid room"))?;
|
||||
let room = cx.new(|cx| {
|
||||
|
@ -416,7 +414,7 @@ impl Room {
|
|||
async fn maintain_connection(
|
||||
this: WeakEntity<Self>,
|
||||
client: Arc<Client>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
let mut client_status = client.status();
|
||||
loop {
|
||||
|
@ -697,7 +695,7 @@ impl Room {
|
|||
async fn handle_room_updated(
|
||||
this: Entity<Self>,
|
||||
envelope: TypedEnvelope<proto::RoomUpdated>,
|
||||
mut cx: AsyncAppContext,
|
||||
mut cx: AsyncApp,
|
||||
) -> Result<()> {
|
||||
let room = envelope
|
||||
.payload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue