Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove cx param
Conrad Irwin1c9b984738ae
diff --git a/crates/copilot_button2/src/copilot_button.rs b/crates/copilot_button2/src/copilot_button.rsindex aab59a9cad5..dc6f8085339 100644--- a/crates/copilot_button2/src/copilot_button.rs+++ b/crates/copilot_button2/src/copilot_button.rs@@ -201,9 +201,8 @@ impl CopilotButton {url: COPILOT_SETTINGS_URL.to_string(),}.boxed_clone(),- cx,)- .action("Sign Out", SignOut.boxed_clone(), cx)+ .action("Sign Out", SignOut.boxed_clone())});}diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rsindex dfad00036e6..6b223243996 100644--- a/crates/editor2/src/editor.rs+++ b/crates/editor2/src/editor.rs@@ -3640,7 +3640,6 @@ impl Editor {}pub fn toggle_code_actions(&mut self, action: &ToggleCodeActions, cx: &mut ViewContext<Self>) {- dbg!("TOGGLE CODE ACTIONS");let mut context_menu = self.context_menu.write();if matches!(context_menu.as_ref(), Some(ContextMenu::CodeActions(_))) {*context_menu = None;diff --git a/crates/editor2/src/mouse_context_menu.rs b/crates/editor2/src/mouse_context_menu.rsindex fdeec9110b9..8b998ccb3a5 100644--- a/crates/editor2/src/mouse_context_menu.rs+++ b/crates/editor2/src/mouse_context_menu.rs@@ -37,19 +37,18 @@ pub fn deploy_context_menu(});let context_menu = ui::ContextMenu::build(cx, |menu, cx| {- menu.action("Rename Symbol", Box::new(Rename), cx)- .action("Go to Definition", Box::new(GoToDefinition), cx)- .action("Go to Type Definition", Box::new(GoToTypeDefinition), cx)- .action("Find All References", Box::new(FindAllReferences), cx)+ menu.action("Rename Symbol", Box::new(Rename))+ .action("Go to Definition", Box::new(GoToDefinition))+ .action("Go to Type Definition", Box::new(GoToTypeDefinition))+ .action("Find All References", Box::new(FindAllReferences)).action("Code Actions",Box::new(ToggleCodeActions {deployed_from_indicator: false,}),- cx,).separator()- .action("Reveal in Finder", Box::new(RevealInFinder), cx)+ .action("Reveal in Finder", Box::new(RevealInFinder))});let context_menu_focus = context_menu.focus_handle(cx);cx.focus(&context_menu_focus);diff --git a/crates/project_panel2/src/project_panel.rs b/crates/project_panel2/src/project_panel.rsindex 0a5a63f14a2..ce039071cf8 100644--- a/crates/project_panel2/src/project_panel.rs+++ b/crates/project_panel2/src/project_panel.rs@@ -397,7 +397,6 @@ impl ProjectPanel {menu = menu.action("Add Folder to Project",Box::new(workspace::AddFolderToProject),- cx,);if is_root {menu = menu.entry(@@ -412,35 +411,35 @@ impl ProjectPanel {}menu = menu- .action("New File", Box::new(NewFile), cx)- .action("New Folder", Box::new(NewDirectory), cx)+ .action("New File", Box::new(NewFile))+ .action("New Folder", Box::new(NewDirectory)).separator()- .action("Cut", Box::new(Cut), cx)- .action("Copy", Box::new(Copy), cx);+ .action("Cut", Box::new(Cut))+ .action("Copy", Box::new(Copy));if let Some(clipboard_entry) = self.clipboard_entry {if clipboard_entry.worktree_id() == worktree_id {- menu = menu.action("Paste", Box::new(Paste), cx);+ menu = menu.action("Paste", Box::new(Paste));}}menu = menu.separator()- .action("Copy Path", Box::new(CopyPath), cx)- .action("Copy Relative Path", Box::new(CopyRelativePath), cx)+ .action("Copy Path", Box::new(CopyPath))+ .action("Copy Relative Path", Box::new(CopyRelativePath)).separator()- .action("Reveal in Finder", Box::new(RevealInFinder), cx);+ .action("Reveal in Finder", Box::new(RevealInFinder));if is_dir {menu = menu- .action("Open in Terminal", Box::new(OpenInTerminal), cx)- .action("Search Inside", Box::new(NewSearchInDirectory), cx)+ .action("Open in Terminal", Box::new(OpenInTerminal))+ .action("Search Inside", Box::new(NewSearchInDirectory))}- menu = menu.separator().action("Rename", Box::new(Rename), cx);+ menu = menu.separator().action("Rename", Box::new(Rename));if !is_root {- menu = menu.action("Delete", Box::new(Delete), cx);+ menu = menu.action("Delete", Box::new(Delete));}menudiff --git a/crates/terminal_view2/src/terminal_view.rs b/crates/terminal_view2/src/terminal_view.rsindex b007d58c34b..4186a610bf0 100644--- a/crates/terminal_view2/src/terminal_view.rs+++ b/crates/terminal_view2/src/terminal_view.rs@@ -299,11 +299,8 @@ impl TerminalView {cx: &mut ViewContext<Self>,) {self.context_menu = Some(ContextMenu::build(cx, |menu, cx| {- menu.action("Clear", Box::new(Clear), cx).action(- "Close",- Box::new(CloseActiveItem { save_intent: None }),- cx,- )+ menu.action("Clear", Box::new(Clear))+ .action("Close", Box::new(CloseActiveItem { save_intent: None }))}));dbg!(&position);// todo!()diff --git a/crates/ui2/src/components/context_menu.rs b/crates/ui2/src/components/context_menu.rsindex 9a5390a8d5e..27aa73b4fe3 100644--- a/crates/ui2/src/components/context_menu.rs+++ b/crates/ui2/src/components/context_menu.rs@@ -76,12 +76,7 @@ impl ContextMenu {self}- pub fn action(- mut self,- label: impl Into<SharedString>,- action: Box<dyn Action>,- cx: &mut WindowContext,- ) -> Self {+ pub fn action(mut self, label: impl Into<SharedString>, action: Box<dyn Action>) -> Self {self.items.push(ContextMenuItem::Entry {label: label.into(),action: Some(action.boxed_clone()),@@ -91,12 +86,7 @@ impl ContextMenu {self}- pub fn link(- mut self,- label: impl Into<SharedString>,- action: Box<dyn Action>,- cx: &mut WindowContext,- ) -> Self {+ pub fn link(mut self, label: impl Into<SharedString>, action: Box<dyn Action>) -> Self {self.items.push(ContextMenuItem::Entry {label: label.into(),action: Some(action.boxed_clone()),diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rsindex 438ad396936..855ce0e931e 100644--- a/crates/workspace2/src/pane.rs+++ b/crates/workspace2/src/pane.rs@@ -1531,24 +1531,17 @@ impl Pane {menu.action("Close Active Item",CloseActiveItem { save_intent: None }.boxed_clone(),- cx,- )- .action("Close Inactive Items", CloseInactiveItems.boxed_clone(), cx)- .action("Close Clean Items", CloseCleanItems.boxed_clone(), cx)- .action(- "Close Items To The Left",- CloseItemsToTheLeft.boxed_clone(),- cx,)+ .action("Close Inactive Items", CloseInactiveItems.boxed_clone())+ .action("Close Clean Items", CloseCleanItems.boxed_clone())+ .action("Close Items To The Left", CloseItemsToTheLeft.boxed_clone()).action("Close Items To The Right",CloseItemsToTheRight.boxed_clone(),- cx,).action("Close All Items",CloseAllItems { save_intent: None }.boxed_clone(),- cx,)})})@@ -1627,17 +1620,12 @@ impl Pane {.child(IconButton::new("plus", Icon::Plus).on_click(cx.listener(|this, _, cx| {let menu = ContextMenu::build(cx, |menu, cx| {- menu.action("New File", NewFile.boxed_clone(), cx)+ menu.action("New File", NewFile.boxed_clone()).action("New Terminal",NewCenterTerminal.boxed_clone(),- cx,- )- .action(- "New Search",- NewSearch.boxed_clone(),- cx,)+ .action("New Search", NewSearch.boxed_clone())});cx.subscribe(&menu,@@ -1661,14 +1649,10 @@ impl Pane {.child(IconButton::new("split", Icon::Split).on_click(cx.listener(|this, _, cx| {let menu = ContextMenu::build(cx, |menu, cx| {- menu.action(- "Split Right",- SplitRight.boxed_clone(),- cx,- )- .action("Split Left", SplitLeft.boxed_clone(), cx)- .action("Split Up", SplitUp.boxed_clone(), cx)- .action("Split Down", SplitDown.boxed_clone(), cx)+ menu.action("Split Right", SplitRight.boxed_clone())+ .action("Split Left", SplitLeft.boxed_clone())+ .action("Split Up", SplitUp.boxed_clone())+ .action("Split Down", SplitDown.boxed_clone())});cx.subscribe(&menu,