diff --git a/Cargo.lock b/Cargo.lock index ddf89ba3cd1e17607070edf039ac59bedfb792ab..f41638122562184f2cb60f7a4d34e0750b85c9cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12607,7 +12607,6 @@ dependencies = [ "call", "client", "collections", - "command_palette", "editor", "feature_flags", "feedback", diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs index 21dd06e81c0ac09d4865d4408e1db7523f3bdd92..11bc6848fe115456bd001b3dfa9f10290c84584f 100644 --- a/crates/command_palette/src/command_palette.rs +++ b/crates/command_palette/src/command_palette.rs @@ -11,7 +11,7 @@ use command_palette_hooks::{ }; use fuzzy::{StringMatch, StringMatchCandidate}; use gpui::{ - actions, Action, AppContext, DismissEvent, EventEmitter, FocusHandle, FocusableView, Global, + Action, AppContext, DismissEvent, EventEmitter, FocusHandle, FocusableView, Global, ParentElement, Render, Styled, Task, UpdateGlobal, View, ViewContext, VisualContext, WeakView, }; use picker::{Picker, PickerDelegate}; @@ -21,9 +21,7 @@ use settings::Settings; use ui::{h_flex, prelude::*, v_flex, HighlightedLabel, KeyBinding, ListItem, ListItemSpacing}; use util::ResultExt; use workspace::{ModalView, Workspace, WorkspaceSettings}; -use zed_actions::OpenZedUrl; - -actions!(command_palette, [Toggle]); +use zed_actions::{command_palette::Toggle, OpenZedUrl}; pub fn init(cx: &mut AppContext) { client::init_settings(cx); diff --git a/crates/title_bar/Cargo.toml b/crates/title_bar/Cargo.toml index 05bd1be5027af81d9e8adf749ace3fb4b45639c5..809915b4dc02aa7de28fb35db0adadf0900d05bb 100644 --- a/crates/title_bar/Cargo.toml +++ b/crates/title_bar/Cargo.toml @@ -31,7 +31,6 @@ test-support = [ auto_update.workspace = true call.workspace = true client.workspace = true -command_palette.workspace = true feedback.workspace = true feature_flags.workspace = true gpui.workspace = true diff --git a/crates/title_bar/src/application_menu.rs b/crates/title_bar/src/application_menu.rs index c3994f81d787170fc0c682e39be39b843d067b1c..3d5a774e8fd7a58ea0716436520d58dac6e42560 100644 --- a/crates/title_bar/src/application_menu.rs +++ b/crates/title_bar/src/application_menu.rs @@ -18,7 +18,10 @@ impl Render for ApplicationMenu { .menu(move |cx| { ContextMenu::build(cx, move |menu, cx| { menu.header("Workspace") - .action("Open Command Palette", Box::new(command_palette::Toggle)) + .action( + "Open Command Palette", + Box::new(zed_actions::command_palette::Toggle), + ) .when_some(cx.focused(), |menu, focused| menu.context(focused)) .custom_row(move |cx| { h_flex() diff --git a/crates/zed/src/zed/app_menus.rs b/crates/zed/src/zed/app_menus.rs index 824704fca5ea464e52f5e6df4d153127192db1bc..4a2f3516271357edc0fdb3b211228297200a8be2 100644 --- a/crates/zed/src/zed/app_menus.rs +++ b/crates/zed/src/zed/app_menus.rs @@ -146,7 +146,7 @@ pub fn app_menus() -> Vec { MenuItem::action("Back", workspace::GoBack), MenuItem::action("Forward", workspace::GoForward), MenuItem::separator(), - MenuItem::action("Command Palette...", command_palette::Toggle), + MenuItem::action("Command Palette...", zed_actions::command_palette::Toggle), MenuItem::separator(), MenuItem::action("Go to File...", workspace::ToggleFileFinder::default()), // MenuItem::action("Go to Symbol in Project", project_symbols::Toggle), diff --git a/crates/zed_actions/src/lib.rs b/crates/zed_actions/src/lib.rs index 53f5b202a86b0c33d92a1ccfc7a73b36adc0f72e..b777f03646c8c29e52b9450aff4d474dc81ce86d 100644 --- a/crates/zed_actions/src/lib.rs +++ b/crates/zed_actions/src/lib.rs @@ -44,6 +44,12 @@ actions!( ] ); +pub mod command_palette { + use gpui::actions; + + actions!(command_palette, [Toggle]); +} + #[derive(Clone, Default, Deserialize, PartialEq)] pub struct InlineAssist { pub prompt: Option,