File entries

This commit is contained in:
Agus Zubiaga 2025-08-12 14:55:27 -03:00
parent 38128bab3e
commit f66e10f965
3 changed files with 1127 additions and 280 deletions

File diff suppressed because it is too large Load diff

View file

@ -141,7 +141,11 @@ impl AcpThreadView {
editor.set_completion_provider(Some(Rc::new(ContextPickerCompletionProvider::new(
mention_set.clone(),
workspace.clone(),
// todo! provide thread stores
None,
None,
cx.weak_entity(),
None,
))));
editor.set_context_menu_options(ContextMenuOptions {
min_entries_visible: 12,
@ -3002,7 +3006,7 @@ impl AcpThreadView {
.unwrap_or(path.path.as_os_str())
.display()
.to_string();
let completion = ContextPickerCompletionProvider::completion_for_path(
let Some(completion) = ContextPickerCompletionProvider::completion_for_path(
path,
&path_prefix,
false,
@ -3013,7 +3017,9 @@ impl AcpThreadView {
self.mention_set.clone(),
self.project.clone(),
cx,
);
) else {
continue;
};
self.message_editor.update(cx, |message_editor, cx| {
message_editor.edit(

View file

@ -1,9 +1,9 @@
mod completion_provider;
mod fetch_context_picker;
pub(crate) mod fetch_context_picker;
pub(crate) mod file_context_picker;
mod rules_context_picker;
mod symbol_context_picker;
mod thread_context_picker;
pub(crate) mod rules_context_picker;
pub(crate) mod symbol_context_picker;
pub(crate) mod thread_context_picker;
use std::ops::Range;
use std::path::{Path, PathBuf};
@ -45,7 +45,7 @@ use agent::{
};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ContextPickerEntry {
pub(crate) enum ContextPickerEntry {
Mode(ContextPickerMode),
Action(ContextPickerAction),
}
@ -74,7 +74,7 @@ impl ContextPickerEntry {
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ContextPickerMode {
pub(crate) enum ContextPickerMode {
File,
Symbol,
Fetch,
@ -83,7 +83,7 @@ enum ContextPickerMode {
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ContextPickerAction {
pub(crate) enum ContextPickerAction {
AddSelections,
}
@ -585,7 +585,8 @@ impl Render for ContextPicker {
})
}
}
enum RecentEntry {
pub(crate) enum RecentEntry {
File {
project_path: ProjectPath,
path_prefix: Arc<str>,
@ -593,7 +594,7 @@ enum RecentEntry {
Thread(ThreadContextEntry),
}
fn available_context_picker_entries(
pub(crate) fn available_context_picker_entries(
prompt_store: &Option<Entity<PromptStore>>,
thread_store: &Option<WeakEntity<ThreadStore>>,
workspace: &Entity<Workspace>,
@ -630,7 +631,7 @@ fn available_context_picker_entries(
entries
}
fn recent_context_picker_entries(
pub(crate) fn recent_context_picker_entries(
context_store: Entity<ContextStore>,
thread_store: Option<WeakEntity<ThreadStore>>,
text_thread_store: Option<WeakEntity<TextThreadStore>>,