Invert dependency between editor and workspace

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-11-24 17:07:16 +01:00
parent 2cf44d30b7
commit e88d3bb97e
10 changed files with 580 additions and 536 deletions

View file

@ -14,5 +14,6 @@ workspace = { path = "../workspace" }
postage = { version = "0.4.1", features = ["futures-traits"] }
[dev-dependencies]
gpui = { path = "../gpui", features = ["test-support"] }
serde_json = { version = "1.0.64", features = ["preserve_order"] }
workspace = { path = "../workspace", features = ["test-support"] }

View file

@ -429,7 +429,14 @@ mod tests {
#[gpui::test]
async fn test_matching_paths(mut cx: gpui::TestAppContext) {
let params = cx.update(WorkspaceParams::test);
let mut entry_openers = Vec::new();
cx.update(|cx| {
super::init(cx);
editor::init(cx, &mut entry_openers);
});
let mut params = cx.update(WorkspaceParams::test);
params.entry_openers = Arc::from(entry_openers);
params
.fs
.as_fake()
@ -443,10 +450,6 @@ mod tests {
}),
)
.await;
cx.update(|cx| {
super::init(cx);
editor::init(cx);
});
let (window_id, workspace) = cx.add_window(|cx| Workspace::new(&params, cx));
workspace