debugger: Add an action to rerun the last session (#31442)

This works the same as selecting the first history match in the new
session modal.

Release Notes:

- Debugger Beta: Added the `debugger: rerun last session` action, bound
by default to `alt-f4`.
This commit is contained in:
Cole Miller 2025-05-26 21:21:11 -04:00 committed by GitHub
parent 092be31b2b
commit 03071a9152
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 58 additions and 1 deletions

View file

@ -47,6 +47,7 @@ actions!(
ShowStackTrace,
ToggleThreadPicker,
ToggleSessionPicker,
RerunLastSession,
]
);
@ -208,7 +209,18 @@ pub fn init(cx: &mut App) {
)
.register_action(|workspace: &mut Workspace, _: &Start, window, cx| {
NewSessionModal::show(workspace, window, cx);
});
})
.register_action(
|workspace: &mut Workspace, _: &RerunLastSession, window, cx| {
let Some(debug_panel) = workspace.panel::<DebugPanel>(cx) else {
return;
};
debug_panel.update(cx, |debug_panel, cx| {
debug_panel.rerun_last_session(workspace, window, cx);
})
},
);
})
})
.detach();