From 3737d4eb4fa9e576204a367b020ba189ac4aa087 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:25:02 +0200 Subject: [PATCH] Add tooltip for code actions icon button (#18461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have just recently discovered this keybinding myself out of talking to folks, ha. The tooltip here might ease the discovery for other folks in the future. Screenshot 2024-09-27 at 11 04 28 PM --- Release Notes: - N/A --- crates/editor/src/editor.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index b604f388debd58ee68a34bc263e8be98437f1e28..d1ca70f705ce56190213de69b3c2ac055ee230be 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -5368,6 +5368,19 @@ impl Editor { .icon_size(IconSize::XSmall) .icon_color(Color::Muted) .selected(is_active) + .tooltip({ + let focus_handle = self.focus_handle.clone(); + move |cx| { + Tooltip::for_action_in( + "Toggle Code Actions", + &ToggleCodeActions { + deployed_from_indicator: None, + }, + &focus_handle, + cx, + ) + } + }) .on_click(cx.listener(move |editor, _e, cx| { editor.focus(cx); editor.toggle_code_actions(