Merge pull request #1867 from zed-industries/drag-project-entry-to-pane

Drag project entry to pane
This commit is contained in:
Kay Simmons 2022-11-10 17:25:22 -08:00 committed by GitHub
commit 3d5a3634cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 455 additions and 198 deletions

View file

@ -818,7 +818,7 @@ mod tests {
// Open the first entry
let entry_1 = workspace
.update(cx, |w, cx| w.open_path(file1.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file1.clone(), None, true, cx))
.await
.unwrap();
cx.read(|cx| {
@ -832,7 +832,7 @@ mod tests {
// Open the second entry
workspace
.update(cx, |w, cx| w.open_path(file2.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file2.clone(), None, true, cx))
.await
.unwrap();
cx.read(|cx| {
@ -846,7 +846,7 @@ mod tests {
// Open the first entry again. The existing pane item is activated.
let entry_1b = workspace
.update(cx, |w, cx| w.open_path(file1.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file1.clone(), None, true, cx))
.await
.unwrap();
assert_eq!(entry_1.id(), entry_1b.id());
@ -864,7 +864,7 @@ mod tests {
workspace
.update(cx, |w, cx| {
w.split_pane(w.active_pane().clone(), SplitDirection::Right, cx);
w.open_path(file2.clone(), true, cx)
w.open_path(file2.clone(), None, true, cx)
})
.await
.unwrap();
@ -883,8 +883,8 @@ mod tests {
// Open the third entry twice concurrently. Only one pane item is added.
let (t1, t2) = workspace.update(cx, |w, cx| {
(
w.open_path(file3.clone(), true, cx),
w.open_path(file3.clone(), true, cx),
w.open_path(file3.clone(), None, true, cx),
w.open_path(file3.clone(), None, true, cx),
)
});
t1.await.unwrap();
@ -1195,7 +1195,7 @@ mod tests {
workspace
.update(cx, |workspace, cx| {
workspace.split_pane(workspace.active_pane().clone(), SplitDirection::Right, cx);
workspace.open_path((worktree.read(cx).id(), "the-new-name.rs"), true, cx)
workspace.open_path((worktree.read(cx).id(), "the-new-name.rs"), None, true, cx)
})
.await
.unwrap();
@ -1284,7 +1284,7 @@ mod tests {
let pane_1 = cx.read(|cx| workspace.read(cx).active_pane().clone());
workspace
.update(cx, |w, cx| w.open_path(file1.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file1.clone(), None, true, cx))
.await
.unwrap();
@ -1359,7 +1359,7 @@ mod tests {
let file3 = entries[2].clone();
let editor1 = workspace
.update(cx, |w, cx| w.open_path(file1.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file1.clone(), None, true, cx))
.await
.unwrap()
.downcast::<Editor>()
@ -1370,13 +1370,13 @@ mod tests {
});
});
let editor2 = workspace
.update(cx, |w, cx| w.open_path(file2.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file2.clone(), None, true, cx))
.await
.unwrap()
.downcast::<Editor>()
.unwrap();
let editor3 = workspace
.update(cx, |w, cx| w.open_path(file3.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file3.clone(), None, true, cx))
.await
.unwrap()
.downcast::<Editor>()
@ -1626,22 +1626,22 @@ mod tests {
let file4 = entries[3].clone();
let file1_item_id = workspace
.update(cx, |w, cx| w.open_path(file1.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file1.clone(), None, true, cx))
.await
.unwrap()
.id();
let file2_item_id = workspace
.update(cx, |w, cx| w.open_path(file2.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file2.clone(), None, true, cx))
.await
.unwrap()
.id();
let file3_item_id = workspace
.update(cx, |w, cx| w.open_path(file3.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file3.clone(), None, true, cx))
.await
.unwrap()
.id();
let file4_item_id = workspace
.update(cx, |w, cx| w.open_path(file4.clone(), true, cx))
.update(cx, |w, cx| w.open_path(file4.clone(), None, true, cx))
.await
.unwrap()
.id();