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:
Anthony Eid 2025-02-04 13:24:35 -05:00 committed by GitHub
parent 27d1c689cf
commit 8c7096f7a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 332 additions and 327 deletions

View file

@ -95,14 +95,14 @@ impl VimTestContext {
Self { cx }
}
pub fn update_entity<F, T, R>(&mut self, model: Entity<T>, update: F) -> R
pub fn update_entity<F, T, R>(&mut self, entity: Entity<T>, update: F) -> R
where
T: 'static,
F: FnOnce(&mut T, &mut Window, &mut Context<T>) -> R + 'static,
{
let window = self.window;
self.update_window(window, move |_, window, cx| {
model.update(cx, |t, cx| update(t, window, cx))
entity.update(cx, |t, cx| update(t, window, cx))
})
.unwrap()
}
@ -131,7 +131,7 @@ impl VimTestContext {
}
pub fn mode(&mut self) -> Mode {
self.update_editor(|editor, _, cx| editor.addon::<VimAddon>().unwrap().model.read(cx).mode)
self.update_editor(|editor, _, cx| editor.addon::<VimAddon>().unwrap().entity.read(cx).mode)
}
pub fn active_operator(&mut self) -> Option<Operator> {
@ -139,7 +139,7 @@ impl VimTestContext {
editor
.addon::<VimAddon>()
.unwrap()
.model
.entity
.read(cx)
.operator_stack
.last()
@ -153,7 +153,7 @@ impl VimTestContext {
self.update_editor(|editor, _window, _cx| editor.addon::<VimAddon>().cloned().unwrap());
self.update(|window, cx| {
vim.model.update(cx, |vim, cx| {
vim.entity.update(cx, |vim, cx| {
vim.switch_mode(mode, true, window, cx);
});
});