From b97843ea02994f029db9cf740fae89ead4417c55 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 22 Sep 2025 16:52:33 +0200 Subject: [PATCH] Add quick "Edit debug.json" button to debugger control strip (#38600) This button already exists in the main menu, as well as the "New Session" view in the debugger panel. However, this view disappears after starting the debugging session. This PR adds the same button to the debugger control strip that remains accessible. This is convenient for people editing their debug.json frequently. Site-node: I feel like the `Cog` icon would be more appropriate, but I picked `Code` to stay consistent with the "New Session" view. Before: image After: image Release Notes: - Added "Edit debug.json" button to debugger control strip --- crates/debugger_ui/src/debugger_panel.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs index f1a1b4dc738f82f729832c60648392af8b9921ed..787bca01acb204a4a50b18a34f3567137f92aa0e 100644 --- a/crates/debugger_ui/src/debugger_panel.rs +++ b/crates/debugger_ui/src/debugger_panel.rs @@ -625,6 +625,15 @@ impl DebugPanel { }) }; + let edit_debug_json_button = || { + IconButton::new("debug-edit-debug-json", IconName::Code) + .icon_size(IconSize::Small) + .on_click(|_, window, cx| { + window.dispatch_action(zed_actions::OpenProjectDebugTasks.boxed_clone(), cx); + }) + .tooltip(Tooltip::text("Edit debug.json")) + }; + let documentation_button = || { IconButton::new("debug-open-documentation", IconName::CircleHelp) .icon_size(IconSize::Small) @@ -899,8 +908,9 @@ impl DebugPanel { ) .when(is_side, |this| { this.child(new_session_button()) - .child(logs_button()) + .child(edit_debug_json_button()) .child(documentation_button()) + .child(logs_button()) }), ) .child( @@ -951,8 +961,9 @@ impl DebugPanel { )) .when(!is_side, |this| { this.child(new_session_button()) - .child(logs_button()) + .child(edit_debug_json_button()) .child(documentation_button()) + .child(logs_button()) }), ), ),