Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

debugger: Fix spec violation with threads request being issued before debug session is initialized (#33627)

Piotr Osiewiczbc5927d5afc3
diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs
index 7490b50530b..b2cd62134f2 100644
--- a/crates/debugger_ui/src/debugger_panel.rs
+++ b/crates/debugger_ui/src/debugger_panel.rs
@@ -868,7 +868,7 @@ impl DebugPanel {
let threads =
running_state.update(cx, |running_state, cx| {
let session = running_state.session();
- session.read(cx).is_running().then(|| {
+ session.read(cx).is_started().then(|| {
session.update(cx, |session, cx| {
session.threads(cx)
})
diff --git a/crates/debugger_ui/src/session/running/console.rs b/crates/debugger_ui/src/session/running/console.rs
index 83d2d46547a..aaac6364018 100644
--- a/crates/debugger_ui/src/session/running/console.rs
+++ b/crates/debugger_ui/src/session/running/console.rs
@@ -114,7 +114,7 @@ impl Console {
}
fn is_running(&self, cx: &Context<Self>) -> bool {
- self.session.read(cx).is_running()
+ self.session.read(cx).is_started()
}
fn handle_stack_frame_list_events(
diff --git a/crates/project/src/debugger/session.rs b/crates/project/src/debugger/session.rs
index 300c598bfb9..255a580e36a 100644
--- a/crates/project/src/debugger/session.rs
+++ b/crates/project/src/debugger/session.rs
@@ -1037,10 +1037,6 @@ impl Session {
matches!(self.mode, Mode::Building)
}
- pub fn is_running(&self) -> bool {
- matches!(self.mode, Mode::Running(_))
- }
-
pub fn as_running_mut(&mut self) -> Option<&mut RunningMode> {
match &mut self.mode {
Mode::Running(local_mode) => Some(local_mode),