Remove more references to 'model' in GPUI APIs (#23693)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-01-26 20:00:27 -08:00 committed by GitHub
parent a6b1514246
commit 9cae96f82f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
115 changed files with 309 additions and 311 deletions

View file

@ -687,7 +687,7 @@ impl LocalBufferStore {
buffer_id,
);
events.push(BufferStoreEvent::BufferChangedFilePath {
buffer: cx.model(),
buffer: cx.entity(),
old_file: buffer.file().cloned(),
});
}
@ -875,7 +875,7 @@ impl LocalBufferStore {
if !push_to_history {
buffer.forget_transaction(transaction.id);
}
project_transaction.0.insert(cx.model(), transaction);
project_transaction.0.insert(cx.entity(), transaction);
}
})?;
}
@ -1302,7 +1302,7 @@ impl BufferStore {
unstaged_changes: None,
};
let handle = cx.model().downgrade();
let handle = cx.entity().downgrade();
buffer.update(cx, move |_, cx| {
cx.on_release(move |buffer, cx| {
handle

View file

@ -39,7 +39,7 @@ impl Manager {
project: &Entity<Project>,
cx: &mut Context<Self>,
) {
let manager = cx.weak_model();
let manager = cx.weak_entity();
project.update(cx, |_, cx| {
let manager = manager.clone();
cx.on_release(move |project, cx| {

View file

@ -122,7 +122,7 @@ impl GitState {
let mut new_repositories = Vec::new();
let mut new_active_index = None;
let this = cx.weak_model();
let this = cx.weak_entity();
worktree_store.update(cx, |worktree_store, cx| {
for worktree in worktree_store.worktrees() {

View file

@ -203,7 +203,7 @@ pub struct ImageStore {
impl ImageStore {
pub fn local(worktree_store: Entity<WorktreeStore>, cx: &mut Context<Self>) -> Self {
let this = cx.weak_model();
let this = cx.weak_entity();
Self {
state: Box::new(cx.new(|cx| {
let subscription = cx.subscribe(

View file

@ -417,7 +417,7 @@ impl LocalLspStore {
let delegate = LocalLspAdapterDelegate::new(
self.languages.clone(),
&self.environment,
cx.weak_model(),
cx.weak_entity(),
&worktree,
self.http_client.clone(),
self.fs.clone(),
@ -5153,7 +5153,7 @@ impl LspStore {
let delegate = LocalLspAdapterDelegate::new(
local.languages.clone(),
&local.environment,
cx.weak_model(),
cx.weak_entity(),
&worktree,
local.http_client.clone(),
local.fs.clone(),
@ -8159,7 +8159,7 @@ impl LanguageServerWatchedPathsBuilder {
language_server_id: LanguageServerId,
cx: &mut Context<LspStore>,
) -> LanguageServerWatchedPaths {
let project = cx.weak_model();
let project = cx.weak_entity();
const LSP_ABS_PATH_OBSERVE: Duration = Duration::from_millis(100);
let abs_paths = self

View file

@ -869,7 +869,7 @@ impl Project {
};
let ssh = ssh.read(cx);
ssh.subscribe_to_entity(SSH_PROJECT_ID, &cx.model());
ssh.subscribe_to_entity(SSH_PROJECT_ID, &cx.entity());
ssh.subscribe_to_entity(SSH_PROJECT_ID, &this.buffer_store);
ssh.subscribe_to_entity(SSH_PROJECT_ID, &this.worktree_store);
ssh.subscribe_to_entity(SSH_PROJECT_ID, &this.lsp_store);
@ -1585,7 +1585,7 @@ impl Project {
self.client_subscriptions.extend([
self.client
.subscribe_to_entity(project_id)?
.set_model(&cx.model(), &mut cx.to_async()),
.set_model(&cx.entity(), &mut cx.to_async()),
self.client
.subscribe_to_entity(project_id)?
.set_model(&self.worktree_store, &mut cx.to_async()),
@ -2427,7 +2427,7 @@ impl Project {
delay
} else {
if first_insertion {
let this = cx.weak_model();
let this = cx.weak_entity();
cx.defer(move |cx| {
if let Some(this) = this.upgrade() {
this.update(cx, |this, cx| {