Clear breakpoints action (#27254)

This PR adds an action that clears all breakpoints and notifies any
active DAPs.

todo
- [x] Implement clear functionality
- [x] Write an integration test for this

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
This commit is contained in:
Anthony Eid 2025-03-21 16:18:08 -04:00 committed by GitHub
parent 16ad7424d6
commit 739f45eb23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 209 additions and 5 deletions

View file

@ -24,8 +24,8 @@ use ui::prelude::*;
use util::ResultExt;
use workspace::{
dock::{DockPosition, Panel, PanelEvent},
pane, Continue, Disconnect, Pane, Pause, Restart, StepBack, StepInto, StepOut, StepOver, Stop,
ToggleIgnoreBreakpoints, Workspace,
pane, ClearBreakpoints, Continue, Disconnect, Pane, Pause, Restart, StepBack, StepInto,
StepOut, StepOver, Stop, ToggleIgnoreBreakpoints, Workspace,
};
pub enum DebugPanelEvent {
@ -174,6 +174,15 @@ impl DebugPanel {
workspace.update_in(cx, |workspace, window, cx| {
let debug_panel = DebugPanel::new(workspace, window, cx);
workspace.register_action(|workspace, _: &ClearBreakpoints, _, cx| {
workspace.project().read(cx).breakpoint_store().update(
cx,
|breakpoint_store, cx| {
breakpoint_store.clear_breakpoints(cx);
},
)
});
cx.observe(&debug_panel, |_, debug_panel, cx| {
let (has_active_session, supports_restart, support_step_back) = debug_panel
.update(cx, |this, cx| {