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

@ -27,7 +27,7 @@ use futures::{
select_biased, AsyncReadExt as _, Future, FutureExt as _, StreamExt as _,
};
use gpui::{
actions, App, AppContext as _, AsyncAppContext, Context, Entity, EventEmitter, Global, Task,
actions, App, AppContext as _, AsyncApp, Context, Entity, EventEmitter, Global, Task,
WeakEntity,
};
use http_client::{AsyncBody, HttpClient, HttpClientWithUrl};
@ -556,7 +556,7 @@ impl ExtensionStore {
async fn upgrade_extensions(
this: WeakEntity<Self>,
extensions: Vec<ExtensionMetadata>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<()> {
for extension in extensions {
let task = this.update(cx, |this, cx| {
@ -1516,7 +1516,7 @@ impl ExtensionStore {
async fn sync_extensions_over_ssh(
this: &WeakEntity<Self>,
client: WeakEntity<SshRemoteClient>,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<()> {
let extensions = this.update(cx, |this, _cx| {
this.extension_index
@ -1581,10 +1581,7 @@ impl ExtensionStore {
anyhow::Ok(())
}
pub async fn update_ssh_clients(
this: &WeakEntity<Self>,
cx: &mut AsyncAppContext,
) -> Result<()> {
pub async fn update_ssh_clients(this: &WeakEntity<Self>, cx: &mut AsyncApp) -> Result<()> {
let clients = this.update(cx, |this, _cx| {
this.ssh_clients.retain(|_k, v| v.upgrade().is_some());
this.ssh_clients.values().cloned().collect::<Vec<_>>()

View file

@ -8,7 +8,7 @@ use extension::{
ExtensionManifest,
};
use fs::{Fs, RemoveOptions, RenameOptions};
use gpui::{App, AppContext as _, AsyncAppContext, Context, Entity, Task, WeakEntity};
use gpui::{App, AppContext as _, AsyncApp, Context, Entity, Task, WeakEntity};
use http_client::HttpClient;
use language::{LanguageConfig, LanguageName, LanguageQueries, LoadedLanguage};
use lsp::LanguageServerName;
@ -113,7 +113,7 @@ impl HeadlessExtensionStore {
pub async fn load_extension(
this: WeakEntity<Self>,
extension: ExtensionVersion,
cx: &mut AsyncAppContext,
cx: &mut AsyncApp,
) -> Result<()> {
let (fs, wasm_host, extension_dir) = this.update(cx, |this, _cx| {
this.loaded_extensions.insert(
@ -258,7 +258,7 @@ impl HeadlessExtensionStore {
pub async fn handle_sync_extensions(
extension_store: Entity<HeadlessExtensionStore>,
envelope: TypedEnvelope<proto::SyncExtensions>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::SyncExtensionsResponse> {
let requested_extensions =
envelope
@ -294,7 +294,7 @@ impl HeadlessExtensionStore {
pub async fn handle_install_extension(
extensions: Entity<HeadlessExtensionStore>,
envelope: TypedEnvelope<proto::InstallExtension>,
mut cx: AsyncAppContext,
mut cx: AsyncApp,
) -> Result<proto::Ack> {
let extension = envelope
.payload

View file

@ -17,7 +17,7 @@ use futures::{
future::BoxFuture,
Future, FutureExt, StreamExt as _,
};
use gpui::{App, AsyncAppContext, BackgroundExecutor, Task};
use gpui::{App, AsyncApp, BackgroundExecutor, Task};
use http_client::HttpClient;
use language::LanguageName;
use lsp::LanguageServerName;
@ -305,8 +305,7 @@ pub struct WasmState {
pub host: Arc<WasmHost>,
}
type MainThreadCall =
Box<dyn Send + for<'a> FnOnce(&'a mut AsyncAppContext) -> LocalBoxFuture<'a, ()>>;
type MainThreadCall = Box<dyn Send + for<'a> FnOnce(&'a mut AsyncApp) -> LocalBoxFuture<'a, ()>>;
type ExtensionCall = Box<
dyn Send + for<'a> FnOnce(&'a mut Extension, &'a mut Store<WasmState>) -> BoxFuture<'a, ()>,
@ -491,7 +490,7 @@ impl WasmExtension {
extension_dir: PathBuf,
manifest: &Arc<ExtensionManifest>,
wasm_host: Arc<WasmHost>,
cx: &AsyncAppContext,
cx: &AsyncApp,
) -> Result<Self> {
let path = extension_dir.join("extension.wasm");
@ -538,7 +537,7 @@ impl WasmState {
fn on_main_thread<T, Fn>(&self, f: Fn) -> impl 'static + Future<Output = T>
where
T: 'static + Send,
Fn: 'static + Send + for<'a> FnOnce(&'a mut AsyncAppContext) -> LocalBoxFuture<'a, T>,
Fn: 'static + Send + for<'a> FnOnce(&'a mut AsyncApp) -> LocalBoxFuture<'a, T>,
{
let (return_tx, return_rx) = oneshot::channel();
self.host