[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/aidermacs 9b6fc62626 071/466: update command and test
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/aidermacs 9b6fc62626 071/466: update command and test |
Date: |
Sat, 15 Mar 2025 19:11:21 -0400 (EDT) |
branch: elpa/aidermacs
commit 9b6fc626265a21daf281cf76dba660aa495ad0cf
Author: tninja <tninja@gmail.com>
Commit: tninja <tninja@gmail.com>
update command and test
---
aider.el | 7 +++++--
test_aider.el | 10 ++++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/aider.el b/aider.el
index 01936b5c98..59631b8cfe 100644
--- a/aider.el
+++ b/aider.el
@@ -201,8 +201,11 @@ replacing all newline characters except for the one at the
end."
(defun aider-region-refactor-generate-command (region-text function-name
user-command)
"Generate the command string based on REGION-TEXT, FUNCTION-NAME, and
USER-COMMAND."
(let ((processed-region-text (replace-regexp-in-string "\n" "\\\\n"
region-text)))
- (format "/architect \"in function %s, for the following code block, %s:
%s\"\n"
- function-name user-command processed-region-text)))
+ (if function-name
+ (format "/architect \"in function %s, for the following code block,
%s: %s\"\n"
+ function-name user-command processed-region-text)
+ (format "/architect \"for the following code block, %s: %s\"\n"
+ user-command processed-region-text))))
(defun aider-region-refactor ()
"Get a command from the user and send it to the corresponding aider comint
buffer based on the selected region.
diff --git a/test_aider.el b/test_aider.el
index e0798d1c92..db4060bc2f 100644
--- a/test_aider.el
+++ b/test_aider.el
@@ -11,3 +11,13 @@
"*aider:~/git/repo/subdir*"))
(should (equal (aider-buffer-name-from-git-repo-path
"/home/username/git/repo/subdir" "/home/username")
"*aider:~/git/repo/subdir*")))
+
+(ert-deftest test-aider-region-refactor-generate-command ()
+ "Test the aider-region-refactor-generate-command function."
+ (should (equal (aider-region-refactor-generate-command "some code"
+ "my-function"
"refactor this")
+ "/architect \"in function my-function, for the following code
block, refactor this: some code\"\n"))
+ (should (equal (aider-region-refactor-generate-command "some code" nil
+ "make it more
functional")
+ "/architect \"for the following code block, make it more
functional: some code\"\n"))
+ )
- [nongnu] elpa/aidermacs f256eda338 146/466: docs: Update README to reflect new function names and usage, (continued)
- [nongnu] elpa/aidermacs f256eda338 146/466: docs: Update README to reflect new function names and usage, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs fcfc5fb0c7 148/466: docs: Update README with improved function descriptions, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs cfd9440622 149/466: docs: Add doc for aider-add-same-type-files-under-dir function, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 0e380aedf9 154/466: docs(keybindings): reorganize aider keybindings for better accessibility, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 778ecf6fb5 156/466: feat: move read-only command and update default model to gemini, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs e08430df58 159/466: docs: Add section for asking questions with Aider, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c8c0c646e8 166/466: Fix: Use correct prefix in aider-add-or-read-current-file, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c1057df534 163/466: Merge pull request #38 from tninja/kang_feat, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 1b4357383b 173/466: Feat: Write unit tests (#46), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs a256968d1f 177/466: Feat: update for aider-minor-mode (#50), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 9b6fc62626 071/466: update command and test,
ELPA Syncer <=
- [nongnu] elpa/aidermacs fe4e4bebeb 079/466: Merge pull request #2 from AmaiKinono/autoload, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 677e867d0f 100/466: Merge branch 'main' of github.com:tninja/aider.el, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 2cf6150925 104/466: Merge branch 'main' of github.com:tninja/aider.el, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs b9c8b7a827 122/466: Merge branch 'main' of github.com:tninja/aider.el, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs cda05246ed 114/466: Merge branch 'main' of github.com:tninja/aider.el, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs 976115dcbc 123/466: Replace series of dash characters with a single separator, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs d57f52202b 137/466: Feat: Improve loading of aider-helm.el (#28), ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs c0ba38906c 200/466: docs(testing): clarify wording around unit tests and TDD support, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs a3e90fea3c 201/466: Don't try to byte-compile aider-doom.el, ELPA Syncer, 2025/03/15
- [nongnu] elpa/aidermacs e09619dcbd 202/466: Merge pull request #72 from marienz/main, ELPA Syncer, 2025/03/15