From 5b6da85e68a6e6d392e683bc85b7cb7a3b964012 Mon Sep 17 00:00:00 2001 From: Peter Schilling Date: Tue, 7 Jan 2025 13:57:38 -0800 Subject: [PATCH 1/3] docs: Update watch.md documentation description and comments --- aider/website/docs/usage/watch.md | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/aider/website/docs/usage/watch.md b/aider/website/docs/usage/watch.md index aa3f73b60e7..51e6c467d35 100644 --- a/aider/website/docs/usage/watch.md +++ b/aider/website/docs/usage/watch.md @@ -3,6 +3,7 @@ title: Aider in your IDE #highlight_image: /assets/browser.jpg parent: Usage nav_order: 750 +# rewrite this description to be relevant to running within an ide ai! description: Aider can run in your browser, not just on the command line. --- @@ -34,7 +35,7 @@ description: Aider can run in your browser, not just on the command line. ## AI comments -If you run aider with `--watch-files`, it will watch all files in your repo +If you run aider with `--watch-files`, it will watch all files in your repo and look for any AI coding instructions you add using your favorite IDE or text editor. Specifically, aider looks for one-liner comments (# ... or // ...) that either start or end with `AI`, `AI!` or `AI?` like these: @@ -52,14 +53,14 @@ Or in `//` comment languages... Aider will take note of all the comments that start or end with `AI`. Comments that include `AI!` with an exclamation point or `AI?` with a question -mark are special. -They triggers aider to take action to collect *all* the AI comments and use them +mark are special. +They triggers aider to take action to collect *all* the AI comments and use them as your instructions. - `AI!` triggers aider to make changes to your code. - `AI?` triggers aider to answer your question. -See the demo video above that shows aider working with AI comments in VSCode. +See the demo video above that shows aider working with AI comments in VSCode. ## Example @@ -88,8 +89,8 @@ Aider only watches for these types of **one-liner** comments: ``` # Python and bash style -// Javascript style --- SQL style +// Javascript style +-- SQL style ``` Aider will look for those comment types in all files. @@ -102,7 +103,7 @@ This capability is quite flexible and powerful, and can be used in many ways. ### In-context instructions -You can add an AI comment in the function you want changed, +You can add an AI comment in the function you want changed, explaining the change request in-context right where you want the changes. ```javascript @@ -129,15 +130,15 @@ Just use `AI!` last, to trigger aider. def factorial(n): if n < 0: return jsonify(error="Factorial is not defined for negative numbers"), 400 - + # AI: Refactor this code... - + result = 1 for i in range(1, n + 1): result *= i - + # ... into to a compute_factorial() function. AI! - + return jsonify(result=result) ``` @@ -180,7 +181,7 @@ many of aider's more advanced features: - Use `/undo` to revert changes you don't like. Although you may also be able to use your IDE's undo function to step back in the file history. - Use [chat modes](https://aider.chat/docs/usage/modes.html) to ask questions or get help. - Manage the chat context with `/tokens`, `/clear`, `/drop`, `/reset`. -Adding an AI comment will add the file to the chat. +Adding an AI comment will add the file to the chat. Periodically, you may want remove extra context that is no longer needed. - [Fix lint and test errors](https://aider.chat/docs/usage/lint-test.html). - Run shell commands. @@ -194,14 +195,14 @@ comments with full sentences, proper capitalization, punctuation, etc. This was done to help explain how AI comments work, but is not needed in practice. Most LLMs are perfectly capable of dealing with ambiguity and -inferring implied intent. +inferring implied intent. This often allows you to be quite lazy with your AI comments. In particular, you can start and end comments with lowercase `ai` and `ai!`, but you can also be much more terse with the request itself. Below are simpler versions of some of the examples given above. When the context clearly implies the needed action, `ai!` might be all you -need. For example, to implement a factorial function +need. For example, to implement a factorial function in a program full of other math functions either of these approaches would probably work: @@ -237,15 +238,15 @@ Similarly, this refactor probably could have been requested with fewer words, li def factorial(n): if n < 0: return jsonify(error="Factorial is not defined for negative numbers"), 400 - + # ai refactor... - + result = 1 for i in range(1, n + 1): result *= i - + # ... to compute_factorial() ai! - + return jsonify(result=result) ``` @@ -289,7 +290,6 @@ todo_app.py: #### Credits -*This feature was inspired by +*This feature was inspired by the way [Override](https://github.com/oi-overide) watches for file changes to find prompts embedded within `//> a specific set of delimiters Date: Tue, 7 Jan 2025 13:57:39 -0800 Subject: [PATCH 2/3] aider: feat: Update watch.md description for IDE usage --- aider/website/docs/usage/watch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/docs/usage/watch.md b/aider/website/docs/usage/watch.md index 51e6c467d35..d14e0880e38 100644 --- a/aider/website/docs/usage/watch.md +++ b/aider/website/docs/usage/watch.md @@ -4,7 +4,7 @@ title: Aider in your IDE parent: Usage nav_order: 750 # rewrite this description to be relevant to running within an ide ai! -description: Aider can run in your browser, not just on the command line. +description: Aider can watch your files and respond to AI comments you add in your favorite IDE or text editor. --- # Aider in your IDE From 4b53b8b6a18cca23ffebc82c16e34803ccb344ea Mon Sep 17 00:00:00 2001 From: Peter Schilling Date: Tue, 7 Jan 2025 14:00:49 -0800 Subject: [PATCH 3/3] --- aider/website/docs/usage/watch.md | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/website/docs/usage/watch.md b/aider/website/docs/usage/watch.md index d14e0880e38..fbb2a1d2f6a 100644 --- a/aider/website/docs/usage/watch.md +++ b/aider/website/docs/usage/watch.md @@ -3,7 +3,6 @@ title: Aider in your IDE #highlight_image: /assets/browser.jpg parent: Usage nav_order: 750 -# rewrite this description to be relevant to running within an ide ai! description: Aider can watch your files and respond to AI comments you add in your favorite IDE or text editor. ---