Remove list_worktrees and use relative paths instead (#26546)

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2025-03-12 16:06:04 +01:00 committed by GitHub
parent 6bf6fcaa51
commit 41eb586ec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 150 additions and 132 deletions

View file

@ -11,6 +11,11 @@ use std::{ops::Range, path::PathBuf, sync::Arc, time::Duration};
use text::LineEnding;
use util::ResultExt;
#[derive(Serialize)]
pub struct AssistantSystemPromptContext {
pub worktree_root_names: Vec<String>,
}
#[derive(Serialize)]
pub struct ContentPromptDiagnosticContext {
pub line_number: usize,
@ -216,6 +221,18 @@ impl PromptBuilder {
Ok(())
}
pub fn generate_assistant_system_prompt(
&self,
worktree_root_names: Vec<String>,
) -> Result<String, RenderError> {
let prompt = AssistantSystemPromptContext {
worktree_root_names,
};
self.handlebars
.lock()
.render("assistant_system_prompt", &prompt)
}
pub fn generate_inline_transformation_prompt(
&self,
user_prompt: String,