debugger: Add close button and coloring to debug panel session's menu (#28310)
This PR adds colors to debug panel's session menu that indicate the state of each respective session. It also adds a close button to each entry. green - running yellow - stopped red - terminated/ended Release Notes: - N/A
This commit is contained in:
parent
ee7b1ec7f2
commit
1774cad933
6 changed files with 173 additions and 44 deletions
|
@ -1,7 +1,7 @@
|
|||
use super::{
|
||||
breakpoint_store::BreakpointStore,
|
||||
locator_store::LocatorStore,
|
||||
session::{self, Session},
|
||||
session::{self, Session, SessionStateEvent},
|
||||
};
|
||||
use crate::{ProjectEnvironment, debugger, worktree_store::WorktreeStore};
|
||||
use anyhow::{Result, anyhow};
|
||||
|
@ -869,6 +869,15 @@ fn create_new_session(
|
|||
}
|
||||
|
||||
this.update(cx, |_, cx| {
|
||||
cx.subscribe(
|
||||
&session,
|
||||
move |this: &mut DapStore, _, event: &SessionStateEvent, cx| match event {
|
||||
SessionStateEvent::Shutdown => {
|
||||
this.shutdown_session(session_id, cx).detach_and_log_err(cx);
|
||||
}
|
||||
},
|
||||
)
|
||||
.detach();
|
||||
cx.emit(DapStoreEvent::DebugSessionInitialized(session_id));
|
||||
})?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue