From e7555d71894c9f11d516703e40fbda7b59405032 Mon Sep 17 00:00:00 2001 From: huqingpeng Date: Fri, 13 Feb 2026 02:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0template.rs:40=20=E7=9A=84=20?= =?UTF-8?q?registered=5Fidentifiers=20=E6=95=B0=E7=BB=84=EF=BC=8C=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E6=89=80=E6=9C=89=E5=AE=9E=E9=99=85=E7=9A=84=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/code2prompt-core/src/template.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/code2prompt-core/src/template.rs b/crates/code2prompt-core/src/template.rs index 362fb15..0047e39 100644 --- a/crates/code2prompt-core/src/template.rs +++ b/crates/code2prompt-core/src/template.rs @@ -37,7 +37,16 @@ pub fn handlebars_setup(template_str: &str, template_name: &str) -> Result` - A vector of undefined variable names. pub fn extract_undefined_variables(template: &str) -> Vec { - let registered_identifiers = ["path", "code", "git_diff"]; + let registered_identifiers = [ + "absolute_code_path", + "source_tree", + "files", + "path", + "code", + "git_diff", + "git_diff_branch", + "git_log_branch" + ]; let re = Regex::new(r"\{\{\s*(?P[a-zA-Z_][a-zA-Z_0-9]*)\s*\}\}").unwrap(); re.captures_iter(template) .map(|cap| cap["var"].to_string())