File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,23 +211,15 @@ pub struct RelatedExcerpt {
211211}
212212
213213pub fn prompt_input_contains_special_tokens ( input : & ZetaPromptInput , format : ZetaFormat ) -> bool {
214- special_tokens_for_format ( format)
215- . iter ( )
216- . any ( |token| {
217- if let Some ( line_token) = token. strip_suffix ( '\n' ) {
218- // Token ends with \n - check if any line in the excerpt equals this token
219- input. cursor_excerpt . lines ( ) . any ( |line| line == line_token)
220- } else {
221- // Token doesn't end with \n - use original substring check
222- input. cursor_excerpt . contains ( token)
223- }
224- } )
214+ special_tokens_for_format ( format) . iter ( ) . any ( |token| {
215+ if let Some ( line_token) = token. strip_suffix ( '\n' ) {
216+ input. cursor_excerpt . lines ( ) . any ( |line| line == line_token)
217+ } else {
218+ input. cursor_excerpt . contains ( token)
219+ }
220+ } )
225221}
226222
227- /// Checks if `text` contains `token` at the start of a line.
228- ///
229-
230-
231223pub fn format_zeta_prompt ( input : & ZetaPromptInput , format : ZetaFormat ) -> Option < String > {
232224 format_prompt_with_budget_for_format ( input, format, MAX_PROMPT_TOKENS )
233225}
@@ -5300,8 +5292,6 @@ mod tests {
53005292 assert_eq ! ( apply_edit( excerpt, & output1) , "new content\n " ) ;
53015293 }
53025294
5303-
5304-
53055295 #[ test]
53065296 fn test_special_tokens_not_triggered_by_comment_separator ( ) {
53075297 // Regression test for https://github.com/zed-industries/zed/issues/52489
You can’t perform that action at this time.
0 commit comments