debugger: Extract running state from DebugSession mode and remove mode field (#29646)

DebugSession.mode is no longer needed because project::debugger::Session
manages its own state now (booting, running, terminated), and removing
mode simplifies a lot of the code that uses running state.

I used Zed AI to do a good chunk of the refactor, but I doubled-checked
everything it did and changed a good amount of its updates.

Release Notes:

- N/A

Co-authored-by: Zed AI <ai@zed.dev>
This commit is contained in:
Anthony Eid 2025-04-30 01:57:53 -04:00 committed by GitHub
parent edf78e770d
commit 9767033985
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 158 additions and 288 deletions

View file

@ -118,8 +118,8 @@ pub fn start_debug_session_with<T: Fn(&Arc<DebugAdapterClient>) + 'static>(
workspace
.panel::<DebugPanel>(cx)
.and_then(|panel| panel.read(cx).active_session())
.and_then(|session| session.read(cx).mode().as_running().cloned())
.map(|running| running.read(cx).session().clone())
.map(|session| session.read(cx).running_state().read(cx).session())
.cloned()
.ok_or_else(|| anyhow!("Failed to get active session"))
})??;