debugger: Focus child sessions if parent has never stopped (#32693)

Closes #ISSUE

Release Notes:

- When debugging JavaScript, Zed will now preselect child sessions by
default.
This commit is contained in:
Piotr Osiewicz 2025-06-13 19:17:51 +02:00 committed by GitHub
parent e59fb2e16a
commit 4370628e30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 6 deletions

View file

@ -404,7 +404,11 @@ impl DebugPanel {
});
(session, task)
})?;
Self::register_session(this, session, false, cx).await?;
// Focus child sessions if the parent has never emitted a stopped event;
// this improves our JavaScript experience, as it always spawns a "main" session that then spawns subsessions.
let parent_ever_stopped =
parent_session.update(cx, |this, _| this.has_ever_stopped())?;
Self::register_session(this, session, !parent_ever_stopped, cx).await?;
task.await
})
.detach_and_log_err(cx);