File entries
This commit is contained in:
parent
38128bab3e
commit
f66e10f965
3 changed files with 1127 additions and 280 deletions
File diff suppressed because it is too large
Load diff
|
@ -141,7 +141,11 @@ impl AcpThreadView {
|
||||||
editor.set_completion_provider(Some(Rc::new(ContextPickerCompletionProvider::new(
|
editor.set_completion_provider(Some(Rc::new(ContextPickerCompletionProvider::new(
|
||||||
mention_set.clone(),
|
mention_set.clone(),
|
||||||
workspace.clone(),
|
workspace.clone(),
|
||||||
|
// todo! provide thread stores
|
||||||
|
None,
|
||||||
|
None,
|
||||||
cx.weak_entity(),
|
cx.weak_entity(),
|
||||||
|
None,
|
||||||
))));
|
))));
|
||||||
editor.set_context_menu_options(ContextMenuOptions {
|
editor.set_context_menu_options(ContextMenuOptions {
|
||||||
min_entries_visible: 12,
|
min_entries_visible: 12,
|
||||||
|
@ -3002,7 +3006,7 @@ impl AcpThreadView {
|
||||||
.unwrap_or(path.path.as_os_str())
|
.unwrap_or(path.path.as_os_str())
|
||||||
.display()
|
.display()
|
||||||
.to_string();
|
.to_string();
|
||||||
let completion = ContextPickerCompletionProvider::completion_for_path(
|
let Some(completion) = ContextPickerCompletionProvider::completion_for_path(
|
||||||
path,
|
path,
|
||||||
&path_prefix,
|
&path_prefix,
|
||||||
false,
|
false,
|
||||||
|
@ -3013,7 +3017,9 @@ impl AcpThreadView {
|
||||||
self.mention_set.clone(),
|
self.mention_set.clone(),
|
||||||
self.project.clone(),
|
self.project.clone(),
|
||||||
cx,
|
cx,
|
||||||
);
|
) else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
|
||||||
self.message_editor.update(cx, |message_editor, cx| {
|
self.message_editor.update(cx, |message_editor, cx| {
|
||||||
message_editor.edit(
|
message_editor.edit(
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
mod completion_provider;
|
mod completion_provider;
|
||||||
mod fetch_context_picker;
|
pub(crate) mod fetch_context_picker;
|
||||||
pub(crate) mod file_context_picker;
|
pub(crate) mod file_context_picker;
|
||||||
mod rules_context_picker;
|
pub(crate) mod rules_context_picker;
|
||||||
mod symbol_context_picker;
|
pub(crate) mod symbol_context_picker;
|
||||||
mod thread_context_picker;
|
pub(crate) mod thread_context_picker;
|
||||||
|
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
@ -45,7 +45,7 @@ use agent::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
enum ContextPickerEntry {
|
pub(crate) enum ContextPickerEntry {
|
||||||
Mode(ContextPickerMode),
|
Mode(ContextPickerMode),
|
||||||
Action(ContextPickerAction),
|
Action(ContextPickerAction),
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ impl ContextPickerEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
enum ContextPickerMode {
|
pub(crate) enum ContextPickerMode {
|
||||||
File,
|
File,
|
||||||
Symbol,
|
Symbol,
|
||||||
Fetch,
|
Fetch,
|
||||||
|
@ -83,7 +83,7 @@ enum ContextPickerMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
enum ContextPickerAction {
|
pub(crate) enum ContextPickerAction {
|
||||||
AddSelections,
|
AddSelections,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,7 +585,8 @@ impl Render for ContextPicker {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enum RecentEntry {
|
|
||||||
|
pub(crate) enum RecentEntry {
|
||||||
File {
|
File {
|
||||||
project_path: ProjectPath,
|
project_path: ProjectPath,
|
||||||
path_prefix: Arc<str>,
|
path_prefix: Arc<str>,
|
||||||
|
@ -593,7 +594,7 @@ enum RecentEntry {
|
||||||
Thread(ThreadContextEntry),
|
Thread(ThreadContextEntry),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn available_context_picker_entries(
|
pub(crate) fn available_context_picker_entries(
|
||||||
prompt_store: &Option<Entity<PromptStore>>,
|
prompt_store: &Option<Entity<PromptStore>>,
|
||||||
thread_store: &Option<WeakEntity<ThreadStore>>,
|
thread_store: &Option<WeakEntity<ThreadStore>>,
|
||||||
workspace: &Entity<Workspace>,
|
workspace: &Entity<Workspace>,
|
||||||
|
@ -630,7 +631,7 @@ fn available_context_picker_entries(
|
||||||
entries
|
entries
|
||||||
}
|
}
|
||||||
|
|
||||||
fn recent_context_picker_entries(
|
pub(crate) fn recent_context_picker_entries(
|
||||||
context_store: Entity<ContextStore>,
|
context_store: Entity<ContextStore>,
|
||||||
thread_store: Option<WeakEntity<ThreadStore>>,
|
thread_store: Option<WeakEntity<ThreadStore>>,
|
||||||
text_thread_store: Option<WeakEntity<TextThreadStore>>,
|
text_thread_store: Option<WeakEntity<TextThreadStore>>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue