You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -262,6 +265,7 @@ line, with proper indentation. If cursor is inside a function, implement
262
265
comments for that function.
263
266
Otherwise implement comments for the entire current file.
264
267
Argument ARG is the prefix argument."
268
+
;; DONE: I want to implement the idea inside https://github.com/tninja/ai-code-interface.el/issues/316, it could to either code change or ask question, given user's input with completing-read selection. The difference of this org-mode section TODO, with the existing comment todo is, it won't replace the TODO section with implementation. It just use the section headline and content inside this section as part of prompt, and send to AI.
265
269
(interactive"P")
266
270
(if (not buffer-file-name)
267
271
(user-error"Error: buffer-file-name must be available")
@@ -330,6 +334,50 @@ Returns non-nil if handled and the caller should exit."
@@ -366,8 +419,8 @@ ARG is the prefix argument for clipboard context."
366
419
(region-comment-block-p (or (not region-text)
367
420
(ai-code--is-comment-block region-text)))
368
421
;; Validate scenario before prompting user
369
-
(_ (unless (or region-text is-comment)
370
-
(user-error"Current line is not a TODO comment and cannot proceed with `ai-code-implement-todo'. Please select a TODO comment (not DONE), a region of comments, or activate on a blank line")))
(user-error"Current line is not a TODO comment or Org TODO headline and cannot proceed with `ai-code-implement-todo'. Please select a TODO comment (not DONE), an Org TODO headline, a region of comments, or activate on a blank line")))
371
424
(_ (unless region-comment-block-p
372
425
(user-error"Selected region must be a comment block")))
373
426
(action-intent (completing-read"Select action: "
@@ -376,29 +429,45 @@ ARG is the prefix argument for clipboard context."
(format"Please implement code for this Org TODO headline first. After implementing, keep the Org TODO headline in place and use the headline and content as prompt context.\nLine %d:\n%s%s%s"
"Please implement code for this requirement comment block in the selected region first. After implementing, keep the comment in place and ensure it begins with a DONE prefix (change TODO to DONE or prepend DONE if no prefix). If this is a pure new code block, place it after the comment; otherwise keep the existing structure and make corresponding change for the context.\n%s\n%s%s%s"
0 commit comments