inspector_ui.rs

 1#[cfg(debug_assertions)]
 2mod div_inspector;
 3#[cfg(debug_assertions)]
 4mod inspector;
 5
 6#[cfg(debug_assertions)]
 7pub use inspector::init;
 8
 9#[cfg(not(debug_assertions))]
10pub fn init(_app_state: std::sync::Arc<workspace::AppState>, cx: &mut gpui::App) {
11    use std::any::TypeId;
12    use workspace::notifications::NotifyResultExt as _;
13
14    cx.on_action(|_: &zed_actions::dev::ToggleInspector, cx| {
15        Err::<(), anyhow::Error>(anyhow::anyhow!(
16            "dev::ToggleInspector is only available in debug builds"
17        ))
18        .notify_app_err(cx);
19    });
20
21    command_palette_hooks::CommandPaletteFilter::update_global(cx, |filter, _cx| {
22        filter.hide_action_types(&[TypeId::of::<zed_actions::dev::ToggleInspector>()]);
23    });
24}