Debugger: Fix breakpoint serialization (#27825)
This PR fixes two bugs that cause unexpected behavior with breakpoints. The first bug made it impossible to delete the last breakpoint in a file in the workspace's database. This caused deleted breakpoints to remain in the database and added to new projects. The second bug was an edge case in the breakpoint context menu where disabling/enabling a breakpoint would sometimes set a new breakpoint on top of the old breakpoint. Release Notes: - N/A
This commit is contained in:
parent
d0276e6666
commit
8075c2458f
4 changed files with 124 additions and 18 deletions
|
@ -988,10 +988,12 @@ impl Workspace {
|
|||
cx.subscribe_in(
|
||||
&project.read(cx).breakpoint_store(),
|
||||
window,
|
||||
|workspace, _, evt, window, cx| {
|
||||
if let BreakpointStoreEvent::BreakpointsUpdated(_, _) = evt {
|
||||
|workspace, _, event, window, cx| match event {
|
||||
BreakpointStoreEvent::BreakpointsUpdated(_, _)
|
||||
| BreakpointStoreEvent::BreakpointsCleared(_) => {
|
||||
workspace.serialize_workspace(window, cx);
|
||||
}
|
||||
BreakpointStoreEvent::ActiveDebugLineChanged => {}
|
||||
},
|
||||
)
|
||||
.detach();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue