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:
parent
16ad7424d6
commit
739f45eb23
5 changed files with 209 additions and 5 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue