zed: Make inline assist quick action dispatch an action (#27445)

This PR makes the "Inline Assist" quick action in the quick action bar
work by dispatching the `InlineAssist` action.

This fixes an issue where the button was not working with Assistant 2.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-25 14:11:30 -04:00 committed by GitHub
parent 24d76a64c3
commit 0339d654d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,6 @@
mod markdown_preview;
mod repl_menu;
use assistant::AssistantPanel;
use assistant_settings::AssistantSettings;
use editor::actions::{
AddSelectionAbove, AddSelectionBelow, DuplicateLineDown, GoToDiagnostic, GoToHunk,
@ -130,20 +129,8 @@ impl Render for QuickActionBar {
Box::new(InlineAssist::default()),
focus_handle.clone(),
"Inline Assist",
{
let workspace = self.workspace.clone();
move |_, window, cx| {
if let Some(workspace) = workspace.upgrade() {
workspace.update(cx, |workspace, cx| {
AssistantPanel::inline_assist(
workspace,
&InlineAssist::default(),
window,
cx,
);
});
}
}
move |_, window, cx| {
window.dispatch_action(Box::new(InlineAssist::default()), cx);
},
);