Allow prompt templates to be overridden in the zed configuration directory (#15887)
I need this to refine our prompts on the fly as I work. Release Notes: - Templates for prompts driving inline transformation in editors and the terminal can now be overridden in the `~/.config/zed/prompts/templates` directory. This is an advanced feature, and prevents you from getting upstream changes. It's intended for use by Zed developers.
This commit is contained in:
parent
6065db174a
commit
c8f1358629
12 changed files with 569 additions and 168 deletions
|
@ -35,6 +35,7 @@ use slash_command::{
|
|||
};
|
||||
use std::sync::Arc;
|
||||
pub(crate) use streaming_diff::*;
|
||||
use util::ResultExt;
|
||||
|
||||
actions!(
|
||||
assistant,
|
||||
|
@ -197,8 +198,17 @@ pub fn init(fs: Arc<dyn Fs>, client: Arc<Client>, cx: &mut AppContext) {
|
|||
assistant_slash_command::init(cx);
|
||||
register_slash_commands(cx);
|
||||
assistant_panel::init(cx);
|
||||
inline_assistant::init(fs.clone(), client.telemetry().clone(), cx);
|
||||
terminal_inline_assistant::init(fs.clone(), client.telemetry().clone(), cx);
|
||||
|
||||
if let Some(prompt_builder) = prompts::PromptBuilder::new(Some((fs.clone(), cx))).log_err() {
|
||||
let prompt_builder = Arc::new(prompt_builder);
|
||||
inline_assistant::init(
|
||||
fs.clone(),
|
||||
prompt_builder.clone(),
|
||||
client.telemetry().clone(),
|
||||
cx,
|
||||
);
|
||||
terminal_inline_assistant::init(fs.clone(), prompt_builder, client.telemetry().clone(), cx);
|
||||
}
|
||||
IndexedDocsRegistry::init_global(cx);
|
||||
|
||||
CommandPaletteFilter::update_global(cx, |filter, _cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue