workspace: Make Item::clone_on_split async (#41211)
Split out from https://github.com/zed-industries/zed/pull/40774 to reduce the size of the reland of that PR (once I figure out the cause of the issue) Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -572,12 +572,14 @@ impl Item for ProjectSearchView {
|
||||
_workspace_id: Option<WorkspaceId>,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Option<Entity<Self>>
|
||||
) -> Task<Option<Entity<Self>>>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let model = self.entity.update(cx, |model, cx| model.clone(cx));
|
||||
Some(cx.new(|cx| Self::new(self.workspace.clone(), model, window, cx, None)))
|
||||
Task::ready(Some(cx.new(|cx| {
|
||||
Self::new(self.workspace.clone(), model, window, cx, None)
|
||||
})))
|
||||
}
|
||||
|
||||
fn added_to_workspace(
|
||||
@@ -3677,6 +3679,7 @@ pub mod tests {
|
||||
)
|
||||
})
|
||||
.unwrap()
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(cx.update(|cx| second_pane.read(cx).items_len()), 1);
|
||||
|
||||
@@ -3872,6 +3875,7 @@ pub mod tests {
|
||||
)
|
||||
})
|
||||
.unwrap()
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(cx.update(|cx| second_pane.read(cx).items_len()), 1);
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user