diff --git a/crates/workspace2/src/item.rs b/crates/workspace2/src/item.rs index 258d32218b..4c09ab06bf 100644 --- a/crates/workspace2/src/item.rs +++ b/crates/workspace2/src/item.rs @@ -401,7 +401,7 @@ impl ItemHandle for View { let pending_update = Arc::new(Mutex::new(None)); let pending_update_scheduled = Arc::new(AtomicBool::new(false)); - let mut _event_subscription = + let mut event_subscription = Some(cx.subscribe(self, move |workspace, item, event, cx| { let pane = if let Some(pane) = workspace .panes_by_item diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index 3bac52e963..08cfbc1ee5 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -3370,9 +3370,9 @@ impl Workspace { workspace: WeakView, serialized_workspace: SerializedWorkspace, paths_to_open: Vec>, - cx: &mut AppContext, + cx: &mut WindowContext, ) -> Task>>>> { - cx.spawn(|mut cx| async move { + cx.spawn(|_, mut cx| async move { let (project, old_center_pane) = workspace.update(&mut cx, |workspace, _| { ( workspace.project().clone(), @@ -3564,7 +3564,7 @@ async fn open_items( workspace: &WeakView, mut project_paths_to_open: Vec<(PathBuf, Option)>, app_state: Arc, - mut cx: AsyncAppContext, + mut cx: MainThread, ) -> Result>>>> { let mut opened_items = Vec::with_capacity(project_paths_to_open.len()); diff --git a/crates/zed2/src/main.rs b/crates/zed2/src/main.rs index 793c6d6139..b5b22db140 100644 --- a/crates/zed2/src/main.rs +++ b/crates/zed2/src/main.rs @@ -313,9 +313,9 @@ async fn installation_id() -> Result { } } -async fn restore_or_create_workspace(_app_state: &Arc, mut _cx: AsyncAppContext) { +async fn restore_or_create_workspace(app_state: &Arc, mut cx: AsyncAppContext) { if let Some(location) = workspace2::last_opened_workspace_paths().await { - cx.update(|cx| workspace2::open_paths(location.paths().as_ref(), app_state, None, cx)) + cx.update(|cx| workspace2::open_paths(location.paths().as_ref(), app_state, None, cx))? .await .log_err(); } else if matches!(KEY_VALUE_STORE.read_kvp(FIRST_OPEN), Ok(None)) {