Extract PromptStore
and PromptBuilder
to new prompt_library
crate (#23254)
This PR adds a new `prompt_library` crate and extracts the `PromptStore` and `PromptBuilder` to it. Eventually we'll want to house the `PromptLibrary` itself in this crate, but right now that involves untangling a few dependencies. Release Notes: - N/A
This commit is contained in:
parent
c9f24c7d45
commit
1b1c2e55f3
24 changed files with 524 additions and 768 deletions
|
@ -9,7 +9,6 @@ mod context_strip;
|
|||
mod inline_assistant;
|
||||
mod inline_prompt_editor;
|
||||
mod message_editor;
|
||||
mod prompts;
|
||||
mod streaming_diff;
|
||||
mod terminal_codegen;
|
||||
mod terminal_inline_assistant;
|
||||
|
@ -26,7 +25,7 @@ use command_palette_hooks::CommandPaletteFilter;
|
|||
use feature_flags::{Assistant2FeatureFlag, FeatureFlagAppExt};
|
||||
use fs::Fs;
|
||||
use gpui::{actions, AppContext};
|
||||
use prompts::PromptLoadingParams;
|
||||
use prompt_library::{PromptBuilder, PromptLoadingParams};
|
||||
use settings::Settings as _;
|
||||
use util::ResultExt;
|
||||
|
||||
|
@ -62,7 +61,7 @@ pub fn init(fs: Arc<dyn Fs>, client: Arc<Client>, stdout_is_a_pty: bool, cx: &mu
|
|||
AssistantSettings::register(cx);
|
||||
assistant_panel::init(cx);
|
||||
|
||||
let prompt_builder = prompts::PromptBuilder::new(Some(PromptLoadingParams {
|
||||
let prompt_builder = PromptBuilder::new(Some(PromptLoadingParams {
|
||||
fs: fs.clone(),
|
||||
repo_path: stdout_is_a_pty
|
||||
.then(|| std::env::current_dir().log_err())
|
||||
|
@ -71,7 +70,7 @@ pub fn init(fs: Arc<dyn Fs>, client: Arc<Client>, stdout_is_a_pty: bool, cx: &mu
|
|||
}))
|
||||
.log_err()
|
||||
.map(Arc::new)
|
||||
.unwrap_or_else(|| Arc::new(prompts::PromptBuilder::new(None).unwrap()));
|
||||
.unwrap_or_else(|| Arc::new(PromptBuilder::new(None).unwrap()));
|
||||
inline_assistant::init(
|
||||
fs.clone(),
|
||||
prompt_builder.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue