WIP

Kirill Bulatov created

Change summary

crates/workspace2/src/item.rs       | 2 +-
crates/workspace2/src/workspace2.rs | 6 +++---
crates/zed2/src/main.rs             | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)

Detailed changes

crates/workspace2/src/item.rs 🔗

@@ -401,7 +401,7 @@ impl<T: Item> ItemHandle for View<T> {
             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

crates/workspace2/src/workspace2.rs 🔗

@@ -3370,9 +3370,9 @@ impl Workspace {
         workspace: WeakView<Workspace>,
         serialized_workspace: SerializedWorkspace,
         paths_to_open: Vec<Option<ProjectPath>>,
-        cx: &mut AppContext,
+        cx: &mut WindowContext,
     ) -> Task<Result<Vec<Option<Box<dyn ItemHandle>>>>> {
-        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<Workspace>,
     mut project_paths_to_open: Vec<(PathBuf, Option<ProjectPath>)>,
     app_state: Arc<AppState>,
-    mut cx: AsyncAppContext,
+    mut cx: MainThread<AsyncAppContext>,
 ) -> Result<Vec<Option<Result<Box<dyn ItemHandle>>>>> {
     let mut opened_items = Vec::with_capacity(project_paths_to_open.len());
 

crates/zed2/src/main.rs 🔗

@@ -313,9 +313,9 @@ async fn installation_id() -> Result<String> {
     }
 }
 
-async fn restore_or_create_workspace(_app_state: &Arc<AppState>, mut _cx: AsyncAppContext) {
+async fn restore_or_create_workspace(app_state: &Arc<AppState>, 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)) {