From b3bc52e28c91a00340686170e73ecc473449ef70 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Thu, 9 Apr 2026 14:20:58 -0700 Subject: [PATCH] Show workspace project group keys in workspace debug dump (#53556) Also indicates if the multiworkspace and the worspace disagree on the right key. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- crates/sidebar/src/sidebar.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index 57fe5a04ac6e656f790d72b1a99dff3e14fa8ead..488127eb0bd04b064c2c6e3b1d8dc297ada9c477 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -4727,6 +4727,36 @@ pub fn dump_workspace_info( ) .ok(); + // project_group_key_for_workspace internally reads the workspace, + // so we can only call it for workspaces other than this_entity + // (which is already being updated). + if let Some(mw) = &multi_workspace { + if *ws == this_entity { + let workspace_key = workspace.project_group_key(cx); + writeln!(output, "ProjectGroupKey: {workspace_key:?}").ok(); + } else { + let effective_key = mw.read(cx).project_group_key_for_workspace(ws, cx); + let workspace_key = ws.read(cx).project_group_key(cx); + if effective_key != workspace_key { + writeln!( + output, + "ProjectGroupKey (multi_workspace): {effective_key:?}" + ) + .ok(); + writeln!( + output, + "ProjectGroupKey (workspace, DISAGREES): {workspace_key:?}" + ) + .ok(); + } else { + writeln!(output, "ProjectGroupKey: {effective_key:?}").ok(); + } + } + } else { + let workspace_key = workspace.project_group_key(cx); + writeln!(output, "ProjectGroupKey: {workspace_key:?}").ok(); + } + // The action handler is already inside an update on `this_entity`, // so we must avoid a nested read/update on that same entity. if *ws == this_entity {