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:
parent
ee4e43f1b6
commit
fa1abd8201
3 changed files with 131 additions and 64 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue