editor: Hide hover popover when code actions context menu is triggered (#31042)

This PR hides hover info/diagnostic popovers when code action menu is
shown. We already hide hover info/diagnostic popover on code completion
menu trigger (handled on input).

Note: It is still possible to see hover popover if code completion or
code action menu is already open. This is intended behavior.

- [x] Test hover popover hides when code action is triggered

Release Notes:

- Fixed issue where info and diagnostic hover popovers were still
visible when code action menu is triggered.
This commit is contained in:
smit 2025-05-21 03:31:35 +05:30 committed by GitHub
parent 4bb04cef9d
commit d547a86e31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 144 additions and 1 deletions

View file

@ -5081,7 +5081,7 @@ impl Editor {
if editor.focus_handle.is_focused(window) && menu.is_some() {
let mut menu = menu.unwrap();
menu.resolve_visible_completions(editor.completion_provider.as_deref(), cx);
crate::hover_popover::hide_hover(editor, cx);
*editor.context_menu.borrow_mut() =
Some(CodeContextMenu::Completions(menu));
@ -5512,6 +5512,7 @@ impl Editor {
.map_or(true, |actions| actions.is_empty())
&& debug_scenarios.is_empty();
if let Ok(task) = editor.update_in(cx, |editor, window, cx| {
crate::hover_popover::hide_hover(editor, cx);
*editor.context_menu.borrow_mut() =
Some(CodeContextMenu::CodeActions(CodeActionsMenu {
buffer,