Skip to content

Commit 7a23d39

Browse files
tninjaKang TuCopilot
authored
Fix: Make org TODO headline section work well with ai-code-implement-todo + helm (#324)
* Remove heading stars from org section heading line * Fix failing tests: update org heading assertions to match stripped-star behavior Agent-Logs-Url: https://github.com/tninja/ai-code-interface.el/sessions/2a36a5e0-132e-498b-89b2-dbc5b9803a3a Co-authored-by: tninja <714625+tninja@users.noreply.github.com> --------- Co-authored-by: Kang Tu <kang_tu@apple.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
1 parent 3d04acf commit 7a23d39

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

ai-code-change.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ The plist contains `:heading-line', `:content', and `:line-number'."
388388
(when org-todo-section-info
389389
(let ((heading-line (plist-get org-todo-section-info :heading-line))
390390
(content (plist-get org-todo-section-info :content)))
391-
(concat heading-line
391+
(concat (replace-regexp-in-string "\\`\\*+ " "" heading-line)
392392
(unless (string-blank-p content)
393393
(concat "\n" content))))))
394394

test/test_ai-code-change.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ is between the function definition and its body."
534534

535535
(should (stringp captured-prompt))
536536
(should (string-match-p "Please implement code" captured-prompt))
537-
(should (string-match-p "\\* TODO Build backend switcher" captured-prompt))
537+
(should (string-match-p "TODO Build backend switcher" captured-prompt))
538538
(should (string-match-p "Use Codex for implementation\\." captured-prompt))
539539
(should (string-match-p "Keep the UI untouched\\." captured-prompt))))))
540540

@@ -578,7 +578,7 @@ is between the function definition and its body."
578578

579579
(should (stringp captured-prompt))
580580
(should (string-match-p "Regarding this Org TODO headline" captured-prompt))
581-
(should (string-match-p "\\*\\* TODO: what is the most important verse in Bible"
581+
(should (string-match-p "TODO: what is the most important verse in Bible"
582582
captured-prompt))))))
583583

584584
(ert-deftest ai-code-test-detect-todo-info-org-todo-headline ()

0 commit comments

Comments
 (0)