Rename model
based variable names to entity
(#24198)
## Context While looking through the client crate, I noticed that some of the old functions and variables were still using gpui::model name that was deprecated during the gpui3 transition. This PR renames those instances of model to entity to be more inline with gpui3. In addition, I also renamed `model` to `entity` in cases found by the below search terms given by @someone13574 - model = cx. - model: Entity - model: &Entity - OpenedModelHandle - model.update - model.upgrade - model = .*\.root (regex) - parent_model - model = cx.new - cx.spawn(move |model Release Notes: - N/A
This commit is contained in:
parent
27d1c689cf
commit
8c7096f7a6
40 changed files with 332 additions and 327 deletions
|
@ -26,9 +26,9 @@ enum ToolchainStoreInner {
|
|||
impl EventEmitter<ToolchainStoreEvent> for ToolchainStore {}
|
||||
impl ToolchainStore {
|
||||
pub fn init(client: &AnyProtoClient) {
|
||||
client.add_model_request_handler(Self::handle_activate_toolchain);
|
||||
client.add_model_request_handler(Self::handle_list_toolchains);
|
||||
client.add_model_request_handler(Self::handle_active_toolchain);
|
||||
client.add_entity_request_handler(Self::handle_activate_toolchain);
|
||||
client.add_entity_request_handler(Self::handle_list_toolchains);
|
||||
client.add_entity_request_handler(Self::handle_active_toolchain);
|
||||
}
|
||||
|
||||
pub fn local(
|
||||
|
@ -37,16 +37,16 @@ impl ToolchainStore {
|
|||
project_environment: Entity<ProjectEnvironment>,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Self {
|
||||
let model = cx.new(|_| LocalToolchainStore {
|
||||
let entity = cx.new(|_| LocalToolchainStore {
|
||||
languages,
|
||||
worktree_store,
|
||||
project_environment,
|
||||
active_toolchains: Default::default(),
|
||||
});
|
||||
let subscription = cx.subscribe(&model, |_, _, e: &ToolchainStoreEvent, cx| {
|
||||
let subscription = cx.subscribe(&entity, |_, _, e: &ToolchainStoreEvent, cx| {
|
||||
cx.emit(e.clone())
|
||||
});
|
||||
Self(ToolchainStoreInner::Local(model, subscription))
|
||||
Self(ToolchainStoreInner::Local(entity, subscription))
|
||||
}
|
||||
pub(super) fn remote(project_id: u64, client: AnyProtoClient, cx: &mut App) -> Self {
|
||||
Self(ToolchainStoreInner::Remote(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue