assistant2: Suggest current file as context (#22526)
Suggest adding the current file as context in the new assistant panel. https://github.com/user-attachments/assets/62bc267b-3dfe-4a3b-a6af-c89af2c779a8 Note: This doesn't include suggesting the current thread in the inline assistant. Release Notes: - N/A
This commit is contained in:
parent
b3e36c93b4
commit
59b5b9af90
8 changed files with 191 additions and 31 deletions
|
@ -1,4 +1,5 @@
|
|||
use gpui::SharedString;
|
||||
use project::ProjectEntryId;
|
||||
|
||||
use crate::context::{Context, ContextId, ContextKind};
|
||||
|
||||
|
@ -44,4 +45,13 @@ impl ContextStore {
|
|||
pub fn remove_context(&mut self, id: &ContextId) {
|
||||
self.context.retain(|context| context.id != *id);
|
||||
}
|
||||
|
||||
pub fn contains_project_entry(&self, entry_id: ProjectEntryId) -> bool {
|
||||
self.context.iter().any(|probe| match probe.kind {
|
||||
ContextKind::File(probe_entry_id) => probe_entry_id == entry_id,
|
||||
ContextKind::Directory => false,
|
||||
ContextKind::FetchedUrl => false,
|
||||
ContextKind::Thread => false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue