Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
debugger: Fix panics when debugging with inline values or confirming in console (#30677)
Anthony Eidf4eea0db2efb
diff --git a/crates/debugger_ui/src/session/running/console.rs b/crates/debugger_ui/src/session/running/console.rsindex 9648865ff88..a98adb0fb81 100644--- a/crates/debugger_ui/src/session/running/console.rs+++ b/crates/debugger_ui/src/session/running/console.rs@@ -150,8 +150,9 @@ impl Console {pub fn evaluate(&mut self, _: &Confirm, window: &mut Window, cx: &mut Context<Self>) {let expression = self.query_bar.update(cx, |editor, cx| {let expression = editor.text(cx);-- editor.clear(window, cx);+ cx.defer_in(window, |editor, window, cx| {+ editor.clear(window, cx);+ });expression});diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 0d68ac73352..924adfc8942 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -3580,7 +3580,9 @@ impl Project {let snapshot = buffer_handle.read(cx).snapshot();- let root_node = snapshot.syntax_root_ancestor(range.end).unwrap();+ let Some(root_node) = snapshot.syntax_root_ancestor(range.end) else {+ return Task::ready(Ok(vec![]));+ };let row = snapshot.summary_for_anchor::<text::PointUtf16>(&range.end)