assistant2: Suggest current thread in inline assistant (#22586)
Release Notes: - N/A --------- Co-authored-by: Marshall <marshall@zed.com>
This commit is contained in:
parent
0e75ca8603
commit
374c298bd5
8 changed files with 161 additions and 114 deletions
|
@ -19,7 +19,7 @@ use workspace::Workspace;
|
|||
use crate::active_thread::ActiveThread;
|
||||
use crate::assistant_settings::{AssistantDockPosition, AssistantSettings};
|
||||
use crate::message_editor::MessageEditor;
|
||||
use crate::thread::{ThreadError, ThreadId};
|
||||
use crate::thread::{Thread, ThreadError, ThreadId};
|
||||
use crate::thread_history::{PastThread, ThreadHistory};
|
||||
use crate::thread_store::ThreadStore;
|
||||
use crate::{NewThread, OpenHistory, ToggleFocus};
|
||||
|
@ -206,6 +206,10 @@ impl AssistantPanel {
|
|||
self.message_editor.focus_handle(cx).focus(cx);
|
||||
}
|
||||
|
||||
pub(crate) fn active_thread(&self, cx: &AppContext) -> Model<Thread> {
|
||||
self.thread.read(cx).thread.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn delete_thread(&mut self, thread_id: &ThreadId, cx: &mut ViewContext<Self>) {
|
||||
self.thread_store
|
||||
.update(cx, |this, cx| this.delete_thread(thread_id, cx));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue