Rename build_view to new_view and build_model to new_model
The word "new" is shorter and blends in with `new` constructors that are common in Rust. Been meaning to do this for a while.
This commit is contained in:
@@ -195,7 +195,7 @@ impl Dock {
|
||||
pub fn new(position: DockPosition, cx: &mut ViewContext<Workspace>) -> View<Self> {
|
||||
let focus_handle = cx.focus_handle();
|
||||
|
||||
let dock = cx.build_view(|cx: &mut ViewContext<Self>| {
|
||||
let dock = cx.new_view(|cx: &mut ViewContext<Self>| {
|
||||
let focus_subscription = cx.on_focus(&focus_handle, |dock, cx| {
|
||||
if let Some(active_entry) = dock.panel_entries.get(dock.active_panel_index) {
|
||||
active_entry.panel.focus_handle(cx).focus(cx)
|
||||
@@ -514,7 +514,7 @@ impl Render for Dock {
|
||||
.id("resize-handle")
|
||||
.on_drag(DraggedDock(position), |dock, cx| {
|
||||
cx.stop_propagation();
|
||||
cx.build_view(|_| dock.clone())
|
||||
cx.new_view(|_| dock.clone())
|
||||
})
|
||||
.on_click(cx.listener(|v, e: &ClickEvent, cx| {
|
||||
if e.down.button == MouseButton::Left && e.down.click_count == 2 {
|
||||
|
||||
@@ -831,14 +831,14 @@ pub mod test {
|
||||
worktree_id: WorktreeId::from_usize(0),
|
||||
path: Path::new(path).into(),
|
||||
});
|
||||
cx.build_model(|_| Self {
|
||||
cx.new_model(|_| Self {
|
||||
entry_id,
|
||||
project_path,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new_untitled(cx: &mut AppContext) -> Model<Self> {
|
||||
cx.build_model(|_| Self {
|
||||
cx.new_model(|_| Self {
|
||||
project_path: None,
|
||||
entry_id: None,
|
||||
})
|
||||
@@ -987,7 +987,7 @@ pub mod test {
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
Some(cx.build_view(|cx| Self {
|
||||
Some(cx.new_view(|cx| Self {
|
||||
state: self.state.clone(),
|
||||
label: self.label.clone(),
|
||||
save_count: self.save_count,
|
||||
@@ -1063,7 +1063,7 @@ pub mod test {
|
||||
_item_id: ItemId,
|
||||
cx: &mut ViewContext<Pane>,
|
||||
) -> Task<anyhow::Result<View<Self>>> {
|
||||
let view = cx.build_view(|cx| Self::new_deserialized(workspace_id, cx));
|
||||
let view = cx.new_view(|cx| Self::new_deserialized(workspace_id, cx));
|
||||
Task::Ready(Some(anyhow::Ok(view)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ impl ModalLayer {
|
||||
return;
|
||||
}
|
||||
}
|
||||
let new_modal = cx.build_view(build_view);
|
||||
let new_modal = cx.new_view(build_view);
|
||||
self.show_modal(new_modal, cx);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ impl Workspace {
|
||||
E: std::fmt::Debug,
|
||||
{
|
||||
self.show_notification(0, cx, |cx| {
|
||||
cx.build_view(|_cx| {
|
||||
cx.new_view(|_cx| {
|
||||
simple_message_notification::MessageNotification::new(format!("Error: {err:?}"))
|
||||
})
|
||||
});
|
||||
@@ -134,7 +134,7 @@ impl Workspace {
|
||||
pub fn show_toast(&mut self, toast: Toast, cx: &mut ViewContext<Self>) {
|
||||
self.dismiss_notification::<simple_message_notification::MessageNotification>(toast.id, cx);
|
||||
self.show_notification(toast.id, cx, |cx| {
|
||||
cx.build_view(|_cx| match toast.on_click.as_ref() {
|
||||
cx.new_view(|_cx| match toast.on_click.as_ref() {
|
||||
Some((click_msg, on_click)) => {
|
||||
let on_click = on_click.clone();
|
||||
simple_message_notification::MessageNotification::new(toast.msg.clone())
|
||||
|
||||
@@ -361,7 +361,7 @@ impl Pane {
|
||||
pane: handle.clone(),
|
||||
next_timestamp,
|
||||
}))),
|
||||
toolbar: cx.build_view(|_| Toolbar::new()),
|
||||
toolbar: cx.new_view(|_| Toolbar::new()),
|
||||
new_item_menu: None,
|
||||
split_item_menu: None,
|
||||
tab_bar_scroll_handle: ScrollHandle::new(),
|
||||
@@ -1540,7 +1540,7 @@ impl Pane {
|
||||
is_active,
|
||||
ix,
|
||||
},
|
||||
|tab, cx| cx.build_view(|_| tab.clone()),
|
||||
|tab, cx| cx.new_view(|_| tab.clone()),
|
||||
)
|
||||
.drag_over::<DraggedTab>(|tab| tab.bg(cx.theme().colors().drop_target_background))
|
||||
.drag_over::<ProjectEntryId>(|tab| tab.bg(cx.theme().colors().drop_target_background))
|
||||
@@ -2241,7 +2241,7 @@ mod tests {
|
||||
set_labeled_items(&pane, ["A", "B*", "C"], cx);
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
Box::new(cx.new_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
false,
|
||||
false,
|
||||
Some(0),
|
||||
@@ -2254,7 +2254,7 @@ mod tests {
|
||||
set_labeled_items(&pane, ["A", "B*", "C"], cx);
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
Box::new(cx.new_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
false,
|
||||
false,
|
||||
Some(2),
|
||||
@@ -2267,7 +2267,7 @@ mod tests {
|
||||
set_labeled_items(&pane, ["A", "B*", "C"], cx);
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
Box::new(cx.new_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
false,
|
||||
false,
|
||||
Some(5),
|
||||
@@ -2281,7 +2281,7 @@ mod tests {
|
||||
set_labeled_items(&pane, ["A*", "B", "C"], cx);
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
Box::new(cx.new_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
@@ -2294,7 +2294,7 @@ mod tests {
|
||||
set_labeled_items(&pane, ["A", "B", "C*"], cx);
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
Box::new(cx.new_view(|cx| TestItem::new(cx).with_label("D"))),
|
||||
false,
|
||||
false,
|
||||
None,
|
||||
@@ -2391,7 +2391,7 @@ mod tests {
|
||||
// singleton view
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| {
|
||||
Box::new(cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_singleton(true)
|
||||
.with_label("buffer 1")
|
||||
@@ -2408,7 +2408,7 @@ mod tests {
|
||||
// new singleton view with the same project entry
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| {
|
||||
Box::new(cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_singleton(true)
|
||||
.with_label("buffer 1")
|
||||
@@ -2425,7 +2425,7 @@ mod tests {
|
||||
// new singleton view with different project entry
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| {
|
||||
Box::new(cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_singleton(true)
|
||||
.with_label("buffer 2")
|
||||
@@ -2442,7 +2442,7 @@ mod tests {
|
||||
// new multibuffer view with the same project entry
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| {
|
||||
Box::new(cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_singleton(false)
|
||||
.with_label("multibuffer 1")
|
||||
@@ -2459,7 +2459,7 @@ mod tests {
|
||||
// another multibuffer view with the same project entry
|
||||
pane.update(cx, |pane, cx| {
|
||||
pane.add_item(
|
||||
Box::new(cx.build_view(|cx| {
|
||||
Box::new(cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_singleton(false)
|
||||
.with_label("multibuffer 1b")
|
||||
@@ -2673,7 +2673,7 @@ mod tests {
|
||||
) -> Box<View<TestItem>> {
|
||||
pane.update(cx, |pane, cx| {
|
||||
let labeled_item = Box::new(
|
||||
cx.build_view(|cx| TestItem::new(cx).with_label(label).with_dirty(is_dirty)),
|
||||
cx.new_view(|cx| TestItem::new(cx).with_label(label).with_dirty(is_dirty)),
|
||||
);
|
||||
pane.add_item(labeled_item.clone(), false, false, None, cx);
|
||||
labeled_item
|
||||
@@ -2696,8 +2696,7 @@ mod tests {
|
||||
active_item_index = index;
|
||||
}
|
||||
|
||||
let labeled_item =
|
||||
Box::new(cx.build_view(|cx| TestItem::new(cx).with_label(label)));
|
||||
let labeled_item = Box::new(cx.new_view(|cx| TestItem::new(cx).with_label(label)));
|
||||
pane.add_item(labeled_item.clone(), false, false, None, cx);
|
||||
index += 1;
|
||||
labeled_item
|
||||
|
||||
@@ -117,7 +117,7 @@ impl Item for SharedScreen {
|
||||
cx: &mut ViewContext<Self>,
|
||||
) -> Option<View<Self>> {
|
||||
let track = self.track.upgrade()?;
|
||||
Some(cx.build_view(|cx| Self::new(&track, self.peer_id, self.user.clone(), cx)))
|
||||
Some(cx.new_view(|cx| Self::new(&track, self.peer_id, self.user.clone(), cx)))
|
||||
}
|
||||
|
||||
fn to_item_events(event: &Self::Event, mut f: impl FnMut(ItemEvent)) {
|
||||
|
||||
@@ -261,7 +261,7 @@ pub fn register_project_item<I: ProjectItem>(cx: &mut AppContext) {
|
||||
let builders = cx.default_global::<ProjectItemBuilders>();
|
||||
builders.insert(TypeId::of::<I::Item>(), |project, model, cx| {
|
||||
let item = model.downcast::<I::Item>().unwrap();
|
||||
Box::new(cx.build_view(|cx| I::for_project_item(project, item, cx)))
|
||||
Box::new(cx.new_view(|cx| I::for_project_item(project, item, cx)))
|
||||
});
|
||||
}
|
||||
|
||||
@@ -358,8 +358,8 @@ impl AppState {
|
||||
let languages = Arc::new(LanguageRegistry::test());
|
||||
let http_client = util::http::FakeHttpClient::with_404_response();
|
||||
let client = Client::new(http_client.clone(), cx);
|
||||
let user_store = cx.build_model(|cx| UserStore::new(client.clone(), cx));
|
||||
let workspace_store = cx.build_model(|cx| WorkspaceStore::new(client.clone(), cx));
|
||||
let user_store = cx.new_model(|cx| UserStore::new(client.clone(), cx));
|
||||
let workspace_store = cx.new_model(|cx| WorkspaceStore::new(client.clone(), cx));
|
||||
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
client::init(&client, cx);
|
||||
@@ -519,7 +519,7 @@ impl Workspace {
|
||||
}
|
||||
|
||||
project::Event::Notification(message) => this.show_notification(0, cx, |cx| {
|
||||
cx.build_view(|_| MessageNotification::new(message.clone()))
|
||||
cx.new_view(|_| MessageNotification::new(message.clone()))
|
||||
}),
|
||||
|
||||
_ => {}
|
||||
@@ -537,7 +537,7 @@ impl Workspace {
|
||||
let weak_handle = cx.view().downgrade();
|
||||
let pane_history_timestamp = Arc::new(AtomicUsize::new(0));
|
||||
|
||||
let center_pane = cx.build_view(|cx| {
|
||||
let center_pane = cx.new_view(|cx| {
|
||||
Pane::new(
|
||||
weak_handle.clone(),
|
||||
project.clone(),
|
||||
@@ -589,10 +589,10 @@ impl Workspace {
|
||||
let left_dock = Dock::new(DockPosition::Left, cx);
|
||||
let bottom_dock = Dock::new(DockPosition::Bottom, cx);
|
||||
let right_dock = Dock::new(DockPosition::Right, cx);
|
||||
let left_dock_buttons = cx.build_view(|cx| PanelButtons::new(left_dock.clone(), cx));
|
||||
let bottom_dock_buttons = cx.build_view(|cx| PanelButtons::new(bottom_dock.clone(), cx));
|
||||
let right_dock_buttons = cx.build_view(|cx| PanelButtons::new(right_dock.clone(), cx));
|
||||
let status_bar = cx.build_view(|cx| {
|
||||
let left_dock_buttons = cx.new_view(|cx| PanelButtons::new(left_dock.clone(), cx));
|
||||
let bottom_dock_buttons = cx.new_view(|cx| PanelButtons::new(bottom_dock.clone(), cx));
|
||||
let right_dock_buttons = cx.new_view(|cx| PanelButtons::new(right_dock.clone(), cx));
|
||||
let status_bar = cx.new_view(|cx| {
|
||||
let mut status_bar = StatusBar::new(¢er_pane.clone(), cx);
|
||||
status_bar.add_left_item(left_dock_buttons, cx);
|
||||
status_bar.add_right_item(right_dock_buttons, cx);
|
||||
@@ -600,7 +600,7 @@ impl Workspace {
|
||||
status_bar
|
||||
});
|
||||
|
||||
let modal_layer = cx.build_view(|_| ModalLayer::new());
|
||||
let modal_layer = cx.new_view(|_| ModalLayer::new());
|
||||
|
||||
let mut active_call = None;
|
||||
if cx.has_global::<Model<ActiveCall>>() {
|
||||
@@ -800,7 +800,7 @@ impl Workspace {
|
||||
let workspace_id = workspace_id.clone();
|
||||
let project_handle = project_handle.clone();
|
||||
move |cx| {
|
||||
cx.build_view(|cx| {
|
||||
cx.new_view(|cx| {
|
||||
Workspace::new(workspace_id, project_handle, app_state, cx)
|
||||
})
|
||||
}
|
||||
@@ -1718,7 +1718,7 @@ impl Workspace {
|
||||
}
|
||||
|
||||
fn add_pane(&mut self, cx: &mut ViewContext<Self>) -> View<Pane> {
|
||||
let pane = cx.build_view(|cx| {
|
||||
let pane = cx.new_view(|cx| {
|
||||
Pane::new(
|
||||
self.weak_handle(),
|
||||
self.project.clone(),
|
||||
@@ -1915,8 +1915,7 @@ impl Workspace {
|
||||
return item;
|
||||
}
|
||||
|
||||
let item =
|
||||
cx.build_view(|cx| T::for_project_item(self.project().clone(), project_item, cx));
|
||||
let item = cx.new_view(|cx| T::for_project_item(self.project().clone(), project_item, cx));
|
||||
self.add_item(Box::new(item.clone()), cx);
|
||||
item
|
||||
}
|
||||
@@ -1940,8 +1939,7 @@ impl Workspace {
|
||||
return item;
|
||||
}
|
||||
|
||||
let item =
|
||||
cx.build_view(|cx| T::for_project_item(self.project().clone(), project_item, cx));
|
||||
let item = cx.new_view(|cx| T::for_project_item(self.project().clone(), project_item, cx));
|
||||
self.split_item(SplitDirection::Right, Box::new(item.clone()), cx);
|
||||
item
|
||||
}
|
||||
@@ -2852,7 +2850,7 @@ impl Workspace {
|
||||
}
|
||||
}
|
||||
|
||||
Some(cx.build_view(|cx| SharedScreen::new(&track, peer_id, user.clone(), cx)))
|
||||
Some(cx.new_view(|cx| SharedScreen::new(&track, peer_id, user.clone(), cx)))
|
||||
}
|
||||
|
||||
pub fn on_window_activation_changed(&mut self, cx: &mut ViewContext<Self>) {
|
||||
@@ -3265,7 +3263,7 @@ impl Workspace {
|
||||
let client = project.read(cx).client();
|
||||
let user_store = project.read(cx).user_store();
|
||||
|
||||
let workspace_store = cx.build_model(|cx| WorkspaceStore::new(client.clone(), cx));
|
||||
let workspace_store = cx.new_model(|cx| WorkspaceStore::new(client.clone(), cx));
|
||||
let app_state = Arc::new(AppState {
|
||||
languages: project.read(cx).languages().clone(),
|
||||
workspace_store,
|
||||
@@ -3468,7 +3466,7 @@ fn notify_if_database_failed(workspace: WindowHandle<Workspace>, cx: &mut AsyncA
|
||||
.update(cx, |workspace, cx| {
|
||||
if (*db::ALL_FILE_DB_FAILED).load(std::sync::atomic::Ordering::Acquire) {
|
||||
workspace.show_notification_once(0, cx, |cx| {
|
||||
cx.build_view(|_| {
|
||||
cx.new_view(|_| {
|
||||
MessageNotification::new("Failed to load the database file.")
|
||||
.with_click_message("Click to let us know about this error")
|
||||
.on_click(|cx| cx.open_url(REPORT_ISSUE_URL))
|
||||
@@ -4180,7 +4178,7 @@ pub fn join_remote_project(
|
||||
cx.update(|cx| {
|
||||
let options = (app_state.build_window_options)(window_bounds_override, None, cx);
|
||||
cx.open_window(options, |cx| {
|
||||
cx.build_view(|cx| Workspace::new(0, project, app_state.clone(), cx))
|
||||
cx.new_view(|cx| Workspace::new(0, project, app_state.clone(), cx))
|
||||
})
|
||||
})?
|
||||
};
|
||||
@@ -4354,7 +4352,7 @@ mod tests {
|
||||
let (workspace, cx) = cx.add_window_view(|cx| Workspace::test_new(project.clone(), cx));
|
||||
|
||||
// Adding an item with no ambiguity renders the tab without detail.
|
||||
let item1 = cx.build_view(|cx| {
|
||||
let item1 = cx.new_view(|cx| {
|
||||
let mut item = TestItem::new(cx);
|
||||
item.tab_descriptions = Some(vec!["c", "b1/c", "a/b1/c"]);
|
||||
item
|
||||
@@ -4366,7 +4364,7 @@ mod tests {
|
||||
|
||||
// Adding an item that creates ambiguity increases the level of detail on
|
||||
// both tabs.
|
||||
let item2 = cx.build_view(|cx| {
|
||||
let item2 = cx.new_view(|cx| {
|
||||
let mut item = TestItem::new(cx);
|
||||
item.tab_descriptions = Some(vec!["c", "b2/c", "a/b2/c"]);
|
||||
item
|
||||
@@ -4380,7 +4378,7 @@ mod tests {
|
||||
// Adding an item that creates ambiguity increases the level of detail only
|
||||
// on the ambiguous tabs. In this case, the ambiguity can't be resolved so
|
||||
// we stop at the highest detail available.
|
||||
let item3 = cx.build_view(|cx| {
|
||||
let item3 = cx.new_view(|cx| {
|
||||
let mut item = TestItem::new(cx);
|
||||
item.tab_descriptions = Some(vec!["c", "b2/c", "a/b2/c"]);
|
||||
item
|
||||
@@ -4421,10 +4419,10 @@ mod tests {
|
||||
project.worktrees().next().unwrap().read(cx).id()
|
||||
});
|
||||
|
||||
let item1 = cx.build_view(|cx| {
|
||||
let item1 = cx.new_view(|cx| {
|
||||
TestItem::new(cx).with_project_items(&[TestProjectItem::new(1, "one.txt", cx)])
|
||||
});
|
||||
let item2 = cx.build_view(|cx| {
|
||||
let item2 = cx.new_view(|cx| {
|
||||
TestItem::new(cx).with_project_items(&[TestProjectItem::new(2, "two.txt", cx)])
|
||||
});
|
||||
|
||||
@@ -4493,15 +4491,15 @@ mod tests {
|
||||
let (workspace, cx) = cx.add_window_view(|cx| Workspace::test_new(project.clone(), cx));
|
||||
|
||||
// When there are no dirty items, there's nothing to do.
|
||||
let item1 = cx.build_view(|cx| TestItem::new(cx));
|
||||
let item1 = cx.new_view(|cx| TestItem::new(cx));
|
||||
workspace.update(cx, |w, cx| w.add_item(Box::new(item1.clone()), cx));
|
||||
let task = workspace.update(cx, |w, cx| w.prepare_to_close(false, cx));
|
||||
assert!(task.await.unwrap());
|
||||
|
||||
// When there are dirty untitled items, prompt to save each one. If the user
|
||||
// cancels any prompt, then abort.
|
||||
let item2 = cx.build_view(|cx| TestItem::new(cx).with_dirty(true));
|
||||
let item3 = cx.build_view(|cx| {
|
||||
let item2 = cx.new_view(|cx| TestItem::new(cx).with_dirty(true));
|
||||
let item3 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_project_items(&[TestProjectItem::new(1, "1.txt", cx)])
|
||||
@@ -4529,24 +4527,24 @@ mod tests {
|
||||
let project = Project::test(fs, None, cx).await;
|
||||
let (workspace, cx) = cx.add_window_view(|cx| Workspace::test_new(project, cx));
|
||||
|
||||
let item1 = cx.build_view(|cx| {
|
||||
let item1 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_project_items(&[TestProjectItem::new(1, "1.txt", cx)])
|
||||
});
|
||||
let item2 = cx.build_view(|cx| {
|
||||
let item2 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_conflict(true)
|
||||
.with_project_items(&[TestProjectItem::new(2, "2.txt", cx)])
|
||||
});
|
||||
let item3 = cx.build_view(|cx| {
|
||||
let item3 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_conflict(true)
|
||||
.with_project_items(&[TestProjectItem::new(3, "3.txt", cx)])
|
||||
});
|
||||
let item4 = cx.build_view(|cx| {
|
||||
let item4 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_project_items(&[TestProjectItem::new_untitled(cx)])
|
||||
@@ -4638,7 +4636,7 @@ mod tests {
|
||||
// workspace items with multiple project entries.
|
||||
let single_entry_items = (0..=4)
|
||||
.map(|project_entry_id| {
|
||||
cx.build_view(|cx| {
|
||||
cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_project_items(&[TestProjectItem::new(
|
||||
@@ -4649,7 +4647,7 @@ mod tests {
|
||||
})
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let item_2_3 = cx.build_view(|cx| {
|
||||
let item_2_3 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_singleton(false)
|
||||
@@ -4658,7 +4656,7 @@ mod tests {
|
||||
single_entry_items[3].read(cx).project_items[0].clone(),
|
||||
])
|
||||
});
|
||||
let item_3_4 = cx.build_view(|cx| {
|
||||
let item_3_4 = cx.new_view(|cx| {
|
||||
TestItem::new(cx)
|
||||
.with_dirty(true)
|
||||
.with_singleton(false)
|
||||
@@ -4745,7 +4743,7 @@ mod tests {
|
||||
let (workspace, cx) = cx.add_window_view(|cx| Workspace::test_new(project, cx));
|
||||
let pane = workspace.update(cx, |workspace, _| workspace.active_pane().clone());
|
||||
|
||||
let item = cx.build_view(|cx| {
|
||||
let item = cx.new_view(|cx| {
|
||||
TestItem::new(cx).with_project_items(&[TestProjectItem::new(1, "1.txt", cx)])
|
||||
});
|
||||
let item_id = item.entity_id();
|
||||
@@ -4864,7 +4862,7 @@ mod tests {
|
||||
let project = Project::test(fs, [], cx).await;
|
||||
let (workspace, cx) = cx.add_window_view(|cx| Workspace::test_new(project, cx));
|
||||
|
||||
let item = cx.build_view(|cx| {
|
||||
let item = cx.new_view(|cx| {
|
||||
TestItem::new(cx).with_project_items(&[TestProjectItem::new(1, "1.txt", cx)])
|
||||
});
|
||||
let pane = workspace.update(cx, |workspace, _| workspace.active_pane().clone());
|
||||
|
||||
Reference in New Issue
Block a user