Debugger UI: Dynamic session contents (#28033)

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
Piotr Osiewicz 2025-04-07 23:22:09 +02:00 committed by GitHub
parent fdaf2a27bf
commit 22b937f27f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 663 additions and 537 deletions

View file

@ -43,14 +43,6 @@ pub enum DebugPanelItemEvent {
Stopped { go_to_stack_frame: bool },
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum ThreadItem {
Console,
LoadedSource,
Modules,
Variables,
}
impl DebugSession {
pub(crate) fn running(
project: Entity<Project>,
@ -60,7 +52,15 @@ impl DebugSession {
window: &mut Window,
cx: &mut App,
) -> Entity<Self> {
let mode = cx.new(|cx| RunningState::new(session.clone(), workspace.clone(), window, cx));
let mode = cx.new(|cx| {
RunningState::new(
session.clone(),
project.clone(),
workspace.clone(),
window,
cx,
)
});
cx.new(|cx| Self {
_subscriptions: [cx.subscribe(&mode, |_, _, _, cx| {
@ -81,6 +81,7 @@ impl DebugSession {
}
}
#[expect(unused)]
pub(crate) fn shutdown(&mut self, cx: &mut Context<Self>) {
match &self.mode {
DebugSessionState::Running(state) => state.update(cx, |state, cx| state.shutdown(cx)),