mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Wire up inline assist quick action
This commit is contained in:
parent
147c99f1a7
commit
d711087529
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -7117,6 +7117,7 @@ dependencies = [
|
||||
name = "quick_action_bar2"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"assistant2",
|
||||
"editor2",
|
||||
"gpui2",
|
||||
"search2",
|
||||
|
@ -9,7 +9,7 @@ path = "src/quick_action_bar.rs"
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
#assistant = { path = "../assistant" }
|
||||
assistant = { package = "assistant2", path = "../assistant2" }
|
||||
editor = { package = "editor2", path = "../editor2" }
|
||||
gpui = { package = "gpui2", path = "../gpui2" }
|
||||
search = { package = "search2", path = "../search2" }
|
||||
|
@ -1,4 +1,4 @@
|
||||
// use assistant::{assistant_panel::InlineAssist, AssistantPanel};
|
||||
use assistant::{AssistantPanel, InlineAssist};
|
||||
use editor::Editor;
|
||||
|
||||
use gpui::{
|
||||
@ -15,7 +15,6 @@ pub struct QuickActionBar {
|
||||
buffer_search_bar: View<BufferSearchBar>,
|
||||
active_item: Option<Box<dyn ItemHandle>>,
|
||||
_inlay_hints_enabled_subscription: Option<Subscription>,
|
||||
#[allow(unused)]
|
||||
workspace: WeakView<Workspace>,
|
||||
}
|
||||
|
||||
@ -56,21 +55,25 @@ impl Render for QuickActionBar {
|
||||
"toggle inline assistant",
|
||||
Icon::MagicWand,
|
||||
false,
|
||||
Box::new(gpui::NoAction),
|
||||
Box::new(InlineAssist),
|
||||
"Inline assistant",
|
||||
|_, _cx| todo!(),
|
||||
{
|
||||
let workspace = self.workspace.clone();
|
||||
move |_, cx| {
|
||||
if let Some(workspace) = workspace.upgrade() {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
AssistantPanel::inline_assist(workspace, &InlineAssist, cx);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
h_stack()
|
||||
.id("quick action bar")
|
||||
.p_1()
|
||||
.gap_2()
|
||||
.child(search_button)
|
||||
.child(
|
||||
div()
|
||||
.border()
|
||||
.border_color(gpui::red())
|
||||
.child(assistant_button),
|
||||
)
|
||||
.child(assistant_button)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user