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:
parent
24d76a64c3
commit
0339d654d2
1 changed files with 2 additions and 15 deletions
|
@ -1,7 +1,6 @@
|
||||||
mod markdown_preview;
|
mod markdown_preview;
|
||||||
mod repl_menu;
|
mod repl_menu;
|
||||||
|
|
||||||
use assistant::AssistantPanel;
|
|
||||||
use assistant_settings::AssistantSettings;
|
use assistant_settings::AssistantSettings;
|
||||||
use editor::actions::{
|
use editor::actions::{
|
||||||
AddSelectionAbove, AddSelectionBelow, DuplicateLineDown, GoToDiagnostic, GoToHunk,
|
AddSelectionAbove, AddSelectionBelow, DuplicateLineDown, GoToDiagnostic, GoToHunk,
|
||||||
|
@ -130,20 +129,8 @@ impl Render for QuickActionBar {
|
||||||
Box::new(InlineAssist::default()),
|
Box::new(InlineAssist::default()),
|
||||||
focus_handle.clone(),
|
focus_handle.clone(),
|
||||||
"Inline Assist",
|
"Inline Assist",
|
||||||
{
|
move |_, window, cx| {
|
||||||
let workspace = self.workspace.clone();
|
window.dispatch_action(Box::new(InlineAssist::default()), cx);
|
||||||
move |_, window, cx| {
|
|
||||||
if let Some(workspace) = workspace.upgrade() {
|
|
||||||
workspace.update(cx, |workspace, cx| {
|
|
||||||
AssistantPanel::inline_assist(
|
|
||||||
workspace,
|
|
||||||
&InlineAssist::default(),
|
|
||||||
window,
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue