Toggle inline completion menu from keyboard (#23380)

This commit is contained in:
Agus Zubiaga 2025-01-20 19:11:13 -03:00 committed by GitHub
parent 3c0acdea5e
commit 919703e6a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 55 additions and 23 deletions

View file

@ -48,6 +48,7 @@ use std::rc::Rc;
use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc};
use terminal_view::terminal_panel::{self, TerminalPanel};
use theme::{ActiveTheme, ThemeSettings};
use ui::PopoverMenuHandle;
use util::markdown::MarkdownString;
use util::{asset_str, ResultExt};
use uuid::Uuid;
@ -164,15 +165,24 @@ pub fn initialize_workspace(
show_software_emulation_warning_if_needed(specs, cx);
}
let popover_menu_handle = PopoverMenuHandle::default();
let inline_completion_button = cx.new_view(|cx| {
inline_completion_button::InlineCompletionButton::new(
workspace.weak_handle(),
app_state.fs.clone(),
app_state.user_store.clone(),
popover_menu_handle.clone(),
cx,
)
});
workspace.register_action({
move |_, _: &inline_completion_button::ToggleMenu, cx| {
popover_menu_handle.toggle(cx);
}
});
let diagnostic_summary =
cx.new_view(|cx| diagnostics::items::DiagnosticIndicator::new(workspace, cx));
let activity_indicator =