Skip to content

Commit e9bc9ed

Browse files
remote_server: Fix opening a new remote project not refreshing the project panel (#18262)
Currently, when open new remote project, project_panel not refresh, we must `ctrl-p` and select an file to refresh the project_panel. After that, project_panel will refresh when remote project window active. Release Notes: - Fixed remote projects not restoring previous locations and not refreshing the project panel on open.
1 parent 9a86012 commit e9bc9ed

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

crates/workspace/src/workspace.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5607,6 +5607,9 @@ pub fn join_dev_server_project(
56075607
})
56085608
});
56095609

5610+
let serialized_workspace: Option<SerializedWorkspace> =
5611+
persistence::DB.workspace_for_dev_server_project(dev_server_project_id);
5612+
56105613
let workspace = if let Some(existing_workspace) = existing_workspace {
56115614
existing_workspace
56125615
} else {
@@ -5620,10 +5623,7 @@ pub fn join_dev_server_project(
56205623
)
56215624
.await?;
56225625

5623-
let serialized_workspace: Option<SerializedWorkspace> =
5624-
persistence::DB.workspace_for_dev_server_project(dev_server_project_id);
5625-
5626-
let workspace_id = if let Some(serialized_workspace) = serialized_workspace {
5626+
let workspace_id = if let Some(ref serialized_workspace) = serialized_workspace {
56275627
serialized_workspace.id
56285628
} else {
56295629
persistence::DB.next_id().await?
@@ -5650,10 +5650,13 @@ pub fn join_dev_server_project(
56505650
}
56515651
};
56525652

5653-
workspace.update(&mut cx, |_, cx| {
5654-
cx.activate(true);
5655-
cx.activate_window();
5656-
})?;
5653+
workspace
5654+
.update(&mut cx, |_, cx| {
5655+
cx.activate(true);
5656+
cx.activate_window();
5657+
open_items(serialized_workspace, vec![], app_state, cx)
5658+
})?
5659+
.await?;
56575660

56585661
anyhow::Ok(workspace)
56595662
})

0 commit comments

Comments
 (0)