Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
20.4k stars 1.88k forks source link

Feature request: vscode extension #68

Open shootdaj opened 1 year ago

shootdaj commented 1 year ago

Would be amazing to have this as an extension to vscode (and Visual Studio if possible) similar to Github Copilot chat. Would really make using this very seamless. Either way, this is an amazingly helpful tool. Thank you

paul-gauthier commented 1 year ago

Thanks for trying aider and making this suggestion.

I've certainly thought about making a VS Code plugin. I guess I'm curious what would be the key benefits you would like to see in such an extension?

My normal workflow is to have my editor open and then beside it have a terminal open where I'm chatting with aider. As aider edits the files, my editor notices the changes and reloads automatically.

I guess I'm wondering if you have specific ideas for how a VS Code extension could provide an improved workflow?

joshuavial commented 1 year ago

The things I'm finding useful in the neovim plugin are

Things i'm thinking about adding are

I did some experiments with vs code and found running aider in its built in terminal was quite stuttery when in streaming mode, and a bit of a black box when it was off. Having a hybrid mode with some kind of progress indicator but not the whole output might be useful

paul-gauthier commented 1 year ago

I did some experiments with vs code and found running aider in its built in terminal was quite stuttery when in streaming mode, and a bit of a black box when it was off. Having a hybrid mode with some kind of progress indicator but not the whole output might be useful

I wonder if --no-pretty would work better? It streams, but doesn't involve python rich for colors, etc.

joshuavial commented 1 year ago

yep, no pretty sorted out the flickering issue.

On Fri, 14 Jul 2023 at 10:25, paul-gauthier @.***> wrote:

I did some experiments with vs code and found running aider in its built in terminal was quite stuttery when in streaming mode, and a bit of a black box when it was off. Having a hybrid mode with some kind of progress indicator but not the whole output might be useful

I wonder if --no-pretty would work better? It streams, but doesn't involve python rich for colors, etc.

— Reply to this email directly, view it on GitHub https://github.com/paul-gauthier/aider/issues/68#issuecomment-1634994266, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARU5OFFUGDRUETIBXMXJLXQBYVFANCNFSM6AAAAAA2BWYNX4 . You are receiving this because you commented.Message ID: @.***>

--

http://enspiral.com/ Joshua Vial Website http://codewithjv.com Twitter @joshuavial http://twitter.com/joshuavial Phone +64 21 684 495 Book a meeting https://calendly.com/joshua-vial

paul-gauthier commented 1 year ago

FYI, aider now detects if it is running inside vscode and disables pretty.

ncd76 commented 1 year ago

+1 for the UI.

Not sure why it needs to be inside VSC - easier to develop I suppose as plugin rather than a full stand alone deployment which would be better as not everyone uses VSC and they are not dependant on each other

Also a full installer. At some point a great tool like this (imo) should have one for wider adoption.

What would a UI do? Everything the CLI can do but with buttons, toggles and text boxes.

I'd be more than happy to help in this regard if appropriate?

younes-io commented 1 year ago

I'm voting for this.. +1

alexturpin commented 1 year ago

Personally what I would love is being able to view the commit diffs in VS Code instead of the CLI. For now I use --no-auto-commits which works great.

omri123 commented 1 year ago

Hi, I would love to experiment with this idea. I have been looking for a good model of human-machine interaction for a long while, and Aider is the best I have seen. Would you like to review the following design?

The extension will be a direct interface to Aider. Activating Aider will open Aider in a terminal, and the user can type commands directly or using various context menus (file explorer -> some-file.txt -> add file to chat, etc.).

Benefits: the extension integrates Aider into the user's regular browsing workflow and makes it accessible via the marketplace.

Futuristic thoughts:

Later on, we can utilize vscode utilities to add information to the chat:

Using vscode-github integration, we can

We can also add aider commands that utilize built-in vscode utilities like "open diff view". By the way, we can also execute diff from Aider outside of vscode.

I plan to put the time and implement it, and your comments will be very valuable for me. Thank you very much:)

hellcats commented 11 months ago

One advantage of an editor interface is the ability to select text as a target for a prompt rather than having to describe what you want changed. I've found myself numbering comments so I can refer to sections of code with less typing. Something like Cursor editor.

omri123 commented 11 months ago

Thank you for this use case! By the way, I have a version in which aider see the code with line numbers. Would you like to try it? I would love to get feedback for it

https://github.com/paul-gauthier/aider/pull/348

hellcats commented 11 months ago

Sure, would love to.

On Nov 19, 2023, at 3:34 PM, omri123 @.***> wrote:

Thank you for this use case! By the way, I have a version in which aider see the code with line numbers. Would you like to try it? I would love to get feedback for it

348 https://github.com/paul-gauthier/aider/pull/348

— Reply to this email directly, view it on GitHub https://github.com/paul-gauthier/aider/issues/68#issuecomment-1817984467, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKEQUJ343WPAYCTC45DSOLYFJ3P3AVCNFSM6AAAAAA2BWYNX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXHE4DINBWG4. You are receiving this because you commented.

luisalrp commented 10 months ago

Is it possible to use it on Cursor?

joshuavial commented 10 months ago

@luisalrp yes - cursor is a clone of vs code so you can just fire up aider in the terminal window. If anyone gets excited enough to build a full vs code plugin then I expect it would work with cursor as well.

MattFlower commented 10 months ago

I just wanted to give a brief plug to my newly minted VSCode Extension for Aider. The extension follows in the footsteps of @joshuavial's neovim plugin in terms of features. Right now the main feature is the automatic addition and removal of files to the chat.

I'm extremely thankful for Aider and happy to contribute in this small way. If you run into any trouble with the extension, please let me know.

In case there was any question, of course I wrote it using Aider!

paul-gauthier commented 10 months ago

@MattFlower thanks so much for building and sharing this! I added a link in the install instructions.

omri123 commented 10 months ago

I would like to tell about a new vscode extension based on aider. This extension allows you to add additional conversation context from github issues and vscode language server. Everything goes with the good known aider command and auto completion. You can download it here

/add \issue-{id}
/add \references-{symbol}
/drop ...
# and a new command to show a context item:
/show ...

You can add any github issue, but only issues assigned to you will appear in autocomplete. The extension uses a fork of aider. @paul-gauthier to reach new audiences, most of the extension README is copied from aiders with an attribute. Are you ok with this arrangement?

0xdevalias commented 4 months ago

Semi-related:

danividalg commented 3 months ago

I just wanted to give a brief plug to my newly minted VSCode Extension for Aider. The extension follows in the footsteps of @joshuavial's neovim plugin in terms of features. Right now the main feature is the automatic addition and removal of files to the chat.

I'm extremely thankful for Aider and happy to contribute in this small way. If you run into any trouble with the extension, please let me know.

In case there was any question, of course I wrote it using Aider!

Hi @MattFlower, thanks for your VS Code extension When do you think it could be possible to fix the problems with Windows ? I would like a lot to be able to use your extension but I have Windows.

Thanks a lot :)

MattFlower commented 3 months ago

Hey @danividalg. When I was last working on it, I remember there not being an obvious fix. I'll try to take another look next week and see if something might have changed.

If you're interested, I'd also happily accept a pull request.

danividalg commented 3 months ago

I don't know how to write VS Code extensions, but I will take a look at your repo just in case I can help, thanks :)

danividalg commented 3 months ago

Hi @MattFlower :) I take a look at your code and I can't see any problem Do you know if there is any way to debug a VS Code extension ?

danividalg commented 3 months ago

Hi @MattFlower, did you see that page ? https://stackoverflow.com/questions/74059732/execute-command-by-creating-terminal-vscode-extension-api

Did you try something as simple as change ?

this._terminal.sendText(/add ${this.getRelativeDirectory(filePath)}); to this._terminal.sendText(/add ${this.getRelativeDirectory(filePath)}, true);

Could you check ? I don't know how to test this change ^:D

vdaita commented 2 months ago

I've been working on my own VSCode extension which is inspired by Aider when it comes to file editing formatting. It doesn't use the Aider terminal interface, but runs entirely with a Webview and some code tying it back to the editor (like for keeping track of which tabs and files are open).

My original version was made with a server providing the LLM responses in mind and with Posthog tracking, but I just pushed a version that's bring-your-own-key and with Posthog disabled by default. The code for it is in the feat-byok branch.

It uses the same unified diff formatting, and I also have functionality that fuzzy-searches for the corresponding snippets to make sure that replacements happen correctly. It's still pretty rough around the edges.

Link to GH Release

tensiondriven commented 2 months ago

Found this thread while looking for a replacement for cursor.ai, which uses a fork of VS Code and adds some additional integration to allow you to "accept" suggestions (no commit, just inline changes). Works ok.

+1 for an "official" aider plugin for vscode

Aider, from what I can tell, is close to the top of the heap for open-source AI coding agents.

To the original question of what benefit it would have to have this integrated as a vscode extension, 1 - With some work, the chat UI could be broken up into sections and richly formatted, like curosr.ai 1.5 - Chat history could be stored, multiple conversations/threads, etc. 2 - Providing an extension with instructions to install would radically improve developer experience and onboading, making Aider a lot more popular, and hopefully contributing to a positive feedback loop that would draw more attention to Aider, resulting in more/better contributions, etc.

arekucr commented 2 months ago

+1 on the VSCode Extension would be great use it with a workflow more similar to copilot or continue.dev

UmutAlihan commented 1 month ago

please remember the developers who utilizes pycharm as well while implementing this feature <3

0xdevalias commented 1 month ago

please remember the developers who utilizes pycharm as well while implementing this feature

@UmutAlihan See

Astlaan commented 1 month ago

In the meantime, two VS Code related ai-driven coding tools are available:

Both of them seem to be closed source however, and they don't allow users to plug in their own models. Cursor, for example, only allows choosing from GPT-4o/Sonnet/their in-house small model. However, this kind of IDE integration is very interesting. On the other hand, continue.dev seems to be one of the most interesting AI-assisted coding extensions for VS Code, although they don't provide AI-driven multi code editing (I think). could perhaps a partnership with continue.dev be interesting?