debugger: Clear active debug line on thread continued (#29811)

I also moved the breakpoint store to session from local mode, because
both remote/local modes will need the ability to remove active debug
lines.

Release Notes:

- N/A
This commit is contained in:
Anthony Eid 2025-05-02 15:24:28 -04:00 committed by GitHub
parent e6b0d8e48b
commit da98e300cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 65 additions and 40 deletions

View file

@ -353,7 +353,6 @@ impl DebugPanel {
};
let dap_store_handle = self.project.read(cx).dap_store().clone();
let breakpoint_store = self.project.read(cx).breakpoint_store();
let definition = parent_session.read(cx).definition().clone();
let mut binary = parent_session.read(cx).binary().clone();
binary.request_args = request.clone();
@ -364,13 +363,7 @@ impl DebugPanel {
dap_store.new_session(definition.clone(), Some(parent_session.clone()), cx);
let task = session.update(cx, |session, cx| {
session.boot(
binary,
worktree,
breakpoint_store,
dap_store_handle.downgrade(),
cx,
)
session.boot(binary, worktree, dap_store_handle.downgrade(), cx)
});
(session, task)
})?;

View file

@ -1663,6 +1663,33 @@ async fn test_active_debug_line_setting(executor: BackgroundExecutor, cx: &mut T
"Second stacktrace request handler was not called"
);
client
.fake_event(dap::messages::Events::Continued(dap::ContinuedEvent {
thread_id: 0,
all_threads_continued: Some(true),
}))
.await;
cx.run_until_parked();
second_editor.update(cx, |editor, _| {
let active_debug_lines: Vec<_> = editor.highlighted_rows::<ActiveDebugLine>().collect();
assert!(
active_debug_lines.is_empty(),
"There shouldn't be any active debug lines"
);
});
main_editor.update(cx, |editor, _| {
let active_debug_lines: Vec<_> = editor.highlighted_rows::<ActiveDebugLine>().collect();
assert!(
active_debug_lines.is_empty(),
"There shouldn't be any active debug lines"
);
});
// Clean up
let shutdown_session = project.update(cx, |project, cx| {
project.dap_store().update(cx, |dap_store, cx| {