Merge branch 'main' into update-assistant-styles

This commit is contained in:
Nate Butler 2023-07-10 10:22:18 -04:00
commit 4029481fd0
140 changed files with 4100 additions and 1106 deletions

View file

@ -12,6 +12,7 @@ use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{
cmp::Reverse,
ffi::OsStr,
fmt::{self, Display},
path::PathBuf,
sync::Arc,
@ -80,6 +81,9 @@ impl SavedConversationMetadata {
let mut conversations = Vec::<SavedConversationMetadata>::new();
while let Some(path) = paths.next().await {
let path = path?;
if path.extension() != Some(OsStr::new("json")) {
continue;
}
let pattern = r" - \d+.zed.json$";
let re = Regex::new(pattern).unwrap();

View file

@ -147,8 +147,9 @@ impl AssistantPanel {
.await
.log_err()
.unwrap_or_default();
this.update(&mut cx, |this, _| {
this.saved_conversations = saved_conversations
this.update(&mut cx, |this, cx| {
this.saved_conversations = saved_conversations;
cx.notify();
})
.ok();
}
@ -1911,7 +1912,7 @@ impl ConversationEditor {
let Some(panel) = workspace.panel::<AssistantPanel>(cx) else {
return;
};
let Some(editor) = workspace.active_item(cx).and_then(|item| item.downcast::<Editor>()) else {
let Some(editor) = workspace.active_item(cx).and_then(|item| item.act_as::<Editor>(cx)) else {
return;
};