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
This commit is contained in:
Eric Holk 2026-04-09 14:20:58 -07:00 • committed by GitHub
parent bd50418150
commit b3bc52e28c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {