From 6afb36fd6f4846b85af1cca98ebd2ddd41ca2048 Mon Sep 17 00:00:00 2001 From: Stanislav Alekseev <43210583+WeetHet@users.noreply.github.com> Date: Tue, 27 Aug 2024 01:22:58 +0300 Subject: [PATCH] Reorganize the context menu a bit (#16773) Follow up to #16080 The idea is that the current context menu became a bit top-heavy over time. Let's reorganisze it into four sections: 1. Finding symbols 2. Editing using lsp and similar 3. Copy/Cut/Paste 4. Getting file location Release Notes: - Reorganized context menu to be a bit less top heavy and have more logical parts Before (a giant part on top and two small ones on the bottom): Screenshot 2024-08-23 at 21 02 33 After (much more balanced): Screenshot 2024-08-23 at 21 01 28 --- crates/editor/src/mouse_context_menu.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/mouse_context_menu.rs b/crates/editor/src/mouse_context_menu.rs index 113035c863..ddaced9fa1 100644 --- a/crates/editor/src/mouse_context_menu.rs +++ b/crates/editor/src/mouse_context_menu.rs @@ -161,19 +161,20 @@ pub fn deploy_context_menu( ui::ContextMenu::build(cx, |menu, _cx| { let builder = menu .on_blur_subscription(Subscription::new(|| {})) - .action("Rename Symbol", Box::new(Rename)) .action("Go to Definition", Box::new(GoToDefinition)) .action("Go to Declaration", Box::new(GoToDeclaration)) .action("Go to Type Definition", Box::new(GoToTypeDefinition)) .action("Go to Implementation", Box::new(GoToImplementation)) .action("Find All References", Box::new(FindAllReferences)) + .separator() + .action("Rename Symbol", Box::new(Rename)) + .action("Format Buffer", Box::new(Format)) .action( "Code Actions", Box::new(ToggleCodeActions { deployed_from_indicator: None, }), ) - .action("Format Buffer", Box::new(Format)) .separator() .action("Cut", Box::new(Cut)) .action("Copy", Box::new(Copy))