Initial support for AI assistant rules files (#27168)

Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Thomas <thomas@zed.dev>
This commit is contained in:
Michael Sloan 2025-03-20 02:30:04 -06:00 committed by GitHub
parent 14920ab910
commit 1180b6fbc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 322 additions and 51 deletions

View file

@ -174,6 +174,7 @@ impl AssistantPanel {
thread_store.clone(),
language_registry.clone(),
message_editor_context_store.clone(),
workspace.clone(),
window,
cx,
)
@ -252,6 +253,7 @@ impl AssistantPanel {
self.thread_store.clone(),
self.language_registry.clone(),
message_editor_context_store.clone(),
self.workspace.clone(),
window,
cx,
)
@ -389,6 +391,7 @@ impl AssistantPanel {
this.thread_store.clone(),
this.language_registry.clone(),
message_editor_context_store.clone(),
this.workspace.clone(),
window,
cx,
)
@ -922,8 +925,8 @@ impl AssistantPanel {
ThreadError::MaxMonthlySpendReached => {
self.render_max_monthly_spend_reached_error(cx)
}
ThreadError::Message(error_message) => {
self.render_error_message(&error_message, cx)
ThreadError::Message { header, message } => {
self.render_error_message(header, message, cx)
}
})
.into_any(),
@ -1026,7 +1029,8 @@ impl AssistantPanel {
fn render_error_message(
&self,
error_message: &SharedString,
header: SharedString,
message: SharedString,
cx: &mut Context<Self>,
) -> AnyElement {
v_flex()
@ -1036,17 +1040,14 @@ impl AssistantPanel {
.gap_1p5()
.items_center()
.child(Icon::new(IconName::XCircle).color(Color::Error))
.child(
Label::new("Error interacting with language model")
.weight(FontWeight::MEDIUM),
),
.child(Label::new(header).weight(FontWeight::MEDIUM)),
)
.child(
div()
.id("error-message")
.max_h_32()
.overflow_y_scroll()
.child(Label::new(error_message.clone())),
.child(Label::new(message)),
)
.child(
h_flex()