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

@ -824,7 +824,7 @@ impl Worktree {
pub fn root_file(&self, cx: &Context<Self>) -> Option<Arc<File>> {
let entry = self.root_entry()?;
Some(File::for_entry(entry.clone(), cx.model()))
Some(File::for_entry(entry.clone(), cx.entity()))
}
pub fn observe_updates<F, Fut>(&mut self, project_id: u64, cx: &Context<Worktree>, callback: F)
@ -1504,7 +1504,7 @@ impl LocalWorktree {
let entry = self.refresh_entry(path.clone(), None, cx);
let is_private = self.is_path_private(path.as_ref());
let worktree = cx.weak_model();
let worktree = cx.weak_entity();
cx.background_executor().spawn(async move {
let abs_path = abs_path?;
let content = fs.load_bytes(&abs_path).await?;

View file

@ -1884,7 +1884,7 @@ async fn test_random_worktree_changes(cx: &mut TestAppContext, mut rng: StdRng)
// all changes to the worktree's snapshot.
fn check_worktree_change_events(tree: &mut Worktree, cx: &mut Context<Worktree>) {
let mut entries = tree.entries(true, 0).cloned().collect::<Vec<_>>();
cx.subscribe(&cx.model(), move |tree, _, event, _| {
cx.subscribe(&cx.entity(), move |tree, _, event, _| {
if let Event::UpdatedEntries(changes) = event {
for (path, _, change_type) in changes.iter() {
let entry = tree.entry_for_path(path).cloned();