debugger: Always focus the active session whenever it is stopped (#31182)

Closes #ISSUE

Release Notes:

- debugger: Fixed child debug sessions taking precedence over the
parents when spawned.
This commit is contained in:
Piotr Osiewicz 2025-05-22 17:23:31 +02:00 committed by GitHub
parent ee4e43f1b6
commit fa1abd8201
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 131 additions and 64 deletions

View file

@ -585,15 +585,26 @@ impl RunningState {
cx.subscribe_in(&session, window, |this, _, event, window, cx| {
match event {
SessionEvent::Stopped(thread_id) => {
this.workspace
let panel = this
.workspace
.update(cx, |workspace, cx| {
workspace.open_panel::<crate::DebugPanel>(window, cx);
workspace.panel::<crate::DebugPanel>(cx)
})
.log_err();
.log_err()
.flatten();
if let Some(thread_id) = thread_id {
this.select_thread(*thread_id, window, cx);
}
if let Some(panel) = panel {
let id = this.session_id;
window.defer(cx, move |window, cx| {
panel.update(cx, |this, cx| {
this.activate_session_by_id(id, window, cx);
})
})
}
}
SessionEvent::Threads => {
let threads = this.session.update(cx, |this, cx| this.threads(cx));