Get tests compiling returning WindowHandle<V: View> from add_window
This commit is contained in:
@@ -69,7 +69,8 @@ impl<'a> EditorLspTestContext<'a> {
|
||||
.insert_tree("/root", json!({ "dir": { file_name.clone(): "" }}))
|
||||
.await;
|
||||
|
||||
let (window_id, workspace) = cx.add_window(|cx| Workspace::test_new(project.clone(), cx));
|
||||
let window = cx.add_window(|cx| Workspace::test_new(project.clone(), cx));
|
||||
let workspace = window.root(cx);
|
||||
project
|
||||
.update(cx, |project, cx| {
|
||||
project.find_or_create_local_worktree("/root", true, cx)
|
||||
@@ -98,7 +99,7 @@ impl<'a> EditorLspTestContext<'a> {
|
||||
Self {
|
||||
cx: EditorTestContext {
|
||||
cx,
|
||||
window_id,
|
||||
window_id: window.id(),
|
||||
editor,
|
||||
},
|
||||
lsp,
|
||||
|
||||
@@ -32,16 +32,14 @@ impl<'a> EditorTestContext<'a> {
|
||||
let buffer = project
|
||||
.update(cx, |project, cx| project.create_buffer("", None, cx))
|
||||
.unwrap();
|
||||
let (window_id, editor) = cx.update(|cx| {
|
||||
cx.add_window(Default::default(), |cx| {
|
||||
cx.focus_self();
|
||||
build_editor(MultiBuffer::build_from_buffer(buffer, cx), cx)
|
||||
})
|
||||
let window = cx.add_window(|cx| {
|
||||
cx.focus_self();
|
||||
build_editor(MultiBuffer::build_from_buffer(buffer, cx), cx)
|
||||
});
|
||||
|
||||
let editor = window.root(cx);
|
||||
Self {
|
||||
cx,
|
||||
window_id,
|
||||
window_id: window.id(),
|
||||
editor,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user