gpui: Update docs to reflect removal of View, ViewContext, WindowContext (#24008)

This PR updates function signatures, docstrings, and gpui's other
documentation to reflect it's new state following the merge of `Model`
and `View` into `Entity` as well as the removal of `WindowContext`.

Release Notes:

- N/A
This commit is contained in:
someone13574 2025-01-31 14:40:42 -05:00 committed by GitHub
parent 027fe1b4b5
commit 0c94bdc8e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 330 additions and 329 deletions

View file

@ -1845,11 +1845,11 @@ mod tests {
let buffer = cx.new(|cx| Buffer::local(buffer_text, cx));
let window = cx.add_window(|_, _| gpui::Empty);
let editor = window.build_model(cx, |window, cx| {
let editor = window.build_entity(cx, |window, cx| {
Editor::for_buffer(buffer.clone(), None, window, cx)
});
let search_bar = window.build_model(cx, |window, cx| {
let search_bar = window.build_entity(cx, |window, cx| {
let mut search_bar = BufferSearchBar::new(window, cx);
search_bar.set_active_pane_item(Some(&editor), window, cx);
search_bar.show(window, cx);

View file

@ -2337,7 +2337,7 @@ pub mod tests {
let project = Project::test(fs.clone(), ["/dir".as_ref()], cx).await;
let window = cx.add_window(|window, cx| Workspace::test_new(project, window, cx));
let workspace = window;
let search_bar = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar = window.build_entity(cx, |_, _| ProjectSearchBar::new());
let active_item = cx.read(|cx| {
workspace
@ -2577,7 +2577,7 @@ pub mod tests {
let project = Project::test(fs.clone(), ["/dir".as_ref()], cx).await;
let window = cx.add_window(|window, cx| Workspace::test_new(project, window, cx));
let workspace = window;
let search_bar = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar = window.build_entity(cx, |_, _| ProjectSearchBar::new());
let active_item = cx.read(|cx| {
workspace
@ -2879,7 +2879,7 @@ pub mod tests {
});
let window = cx.add_window(|window, cx| Workspace::test_new(project, window, cx));
let workspace = window.root(cx).unwrap();
let search_bar = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar = window.build_entity(cx, |_, _| ProjectSearchBar::new());
let active_item = cx.read(|cx| {
workspace
@ -2997,7 +2997,7 @@ pub mod tests {
let project = Project::test(fs.clone(), ["/dir".as_ref()], cx).await;
let window = cx.add_window(|window, cx| Workspace::test_new(project, window, cx));
let workspace = window.root(cx).unwrap();
let search_bar = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar = window.build_entity(cx, |_, _| ProjectSearchBar::new());
window
.update(cx, {
@ -3333,8 +3333,8 @@ pub mod tests {
.update(cx, |this, _, _| this.panes().to_owned())
.unwrap();
let search_bar_1 = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar_2 = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar_1 = window.build_entity(cx, |_, _| ProjectSearchBar::new());
let search_bar_2 = window.build_entity(cx, |_, _| ProjectSearchBar::new());
assert_eq!(panes.len(), 1);
let first_pane = panes.first().cloned().unwrap();
@ -3587,7 +3587,7 @@ pub mod tests {
.focus_handle(cx)
.contains_focused(window, cx))
.unwrap());
let search_bar = window.build_model(cx, |_, _| ProjectSearchBar::new());
let search_bar = window.build_entity(cx, |_, _| ProjectSearchBar::new());
window
.update(cx, {
let search_bar = search_bar.clone();