mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
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: <img width="194" height="118" alt="image" src="https://github.com/user-attachments/assets/5b42a8a4-f48f-4145-a425-53365dd785ca" /> After: <img width="194" height="118" alt="image" src="https://github.com/user-attachments/assets/12f56ea1-150b-4564-8e6a-da4671f52079" /> Release Notes: - Added "Edit debug.json" button to debugger control strip
This commit is contained in:
parent
fbe06238e4
commit
b97843ea02
1 changed files with 13 additions and 2 deletions
|
|
@ -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())
|
||||
}),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue