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.

Add TestCrash action (#35088)

Julia Ryan9071341a1da9
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index 57534c8cd54..0a90f89fa41 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -111,6 +111,8 @@ actions!(
Zoom,
/// Triggers a test panic for debugging.
TestPanic,
+ /// Triggers a hard crash for debugging.
+ TestCrash,
]
);
@@ -126,6 +128,14 @@ pub fn init(cx: &mut App) {
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
+ cx.on_action(|_: &TestCrash, _| {
+ unsafe extern "C" {
+ fn puts(s: *const i8);
+ }
+ unsafe {
+ puts(0xabad1d3a as *const i8);
+ }
+ });
}
cx.on_action(|_: &OpenLog, cx| {
with_active_or_new_workspace(cx, |workspace, window, cx| {