keymap_editor: Move OpenKeymapEditor action into zed_actions (#37928)

Piotr Osiewicz created

This lets us remove title_bar's dependency on keymap_editor, which in
turns improves dev build times by ~0.5s for me

Release Notes:

- N/A

Change summary

Cargo.lock                                | 1 -
crates/keymap_editor/src/keymap_editor.rs | 9 +--------
crates/title_bar/Cargo.toml               | 1 -
crates/title_bar/src/title_bar.rs         | 5 ++---
crates/zed/src/zed/app_menus.rs           | 2 +-
crates/zed_actions/src/lib.rs             | 2 ++
6 files changed, 6 insertions(+), 14 deletions(-)

Detailed changes

Cargo.lock πŸ”—

@@ -16710,7 +16710,6 @@ dependencies = [
  "db",
  "gpui",
  "http_client",
- "keymap_editor",
  "notifications",
  "pretty_assertions",
  "project",

crates/keymap_editor/src/keymap_editor.rs πŸ”—

@@ -37,6 +37,7 @@ use workspace::{
 };
 
 pub use ui_components::*;
+use zed_actions::OpenKeymapEditor;
 
 use crate::{
     persistence::KEYBINDING_EDITORS,
@@ -48,14 +49,6 @@ use crate::{
 
 const NO_ACTION_ARGUMENTS_TEXT: SharedString = SharedString::new_static("<no arguments>");
 
-actions!(
-    zed,
-    [
-        /// Opens the keymap editor.
-        OpenKeymapEditor
-    ]
-);
-
 actions!(
     keymap_editor,
     [

crates/title_bar/Cargo.toml πŸ”—

@@ -42,7 +42,6 @@ rpc.workspace = true
 schemars.workspace = true
 serde.workspace = true
 settings.workspace = true
-keymap_editor.workspace = true
 smallvec.workspace = true
 story = { workspace = true, optional = true }
 telemetry.workspace = true

crates/title_bar/src/title_bar.rs πŸ”—

@@ -29,7 +29,6 @@ use gpui::{
     IntoElement, MouseButton, ParentElement, Render, StatefulInteractiveElement, Styled,
     Subscription, WeakEntity, Window, actions, div,
 };
-use keymap_editor;
 use onboarding_banner::OnboardingBanner;
 use project::{Project, WorktreeSettings};
 use remote::RemoteConnectionOptions;
@@ -705,7 +704,7 @@ impl TitleBar {
                             "Settings Profiles",
                             zed_actions::settings_profile_selector::Toggle.boxed_clone(),
                         )
-                        .action("Keymap Editor", Box::new(keymap_editor::OpenKeymapEditor))
+                        .action("Keymap Editor", Box::new(zed_actions::OpenKeymapEditor))
                         .action(
                             "Themes…",
                             zed_actions::theme_selector::Toggle::default().boxed_clone(),
@@ -753,7 +752,7 @@ impl TitleBar {
                                 "Settings Profiles",
                                 zed_actions::settings_profile_selector::Toggle.boxed_clone(),
                             )
-                            .action("Key Bindings", Box::new(keymap_editor::OpenKeymapEditor))
+                            .action("Key Bindings", Box::new(zed_actions::OpenKeymapEditor))
                             .action(
                                 "Themes…",
                                 zed_actions::theme_selector::Toggle::default().boxed_clone(),

crates/zed/src/zed/app_menus.rs πŸ”—

@@ -17,7 +17,7 @@ pub fn app_menus() -> Vec<Menu> {
                     name: "Settings".into(),
                     items: vec![
                         MenuItem::action("Open Settings", super::OpenSettings),
-                        MenuItem::action("Open Key Bindings", keymap_editor::OpenKeymapEditor),
+                        MenuItem::action("Open Key Bindings", zed_actions::OpenKeymapEditor),
                         MenuItem::action("Open Default Settings", super::OpenDefaultSettings),
                         MenuItem::action(
                             "Open Default Key Bindings",

crates/zed_actions/src/lib.rs πŸ”—

@@ -36,6 +36,8 @@ actions!(
         OpenDefaultKeymap,
         /// Opens account settings.
         OpenAccountSettings,
+        /// Opens the keymap editor.
+        OpenKeymapEditor,
         /// Opens server settings.
         OpenServerSettings,
         /// Quits the application.