rubberduck-ai / rubberduck-vscode

Use AI-powered code edits, explanations, code generation, error diagnosis, and chat in Visual Studio Code with the official OpenAI API.
https://marketplace.visualstudio.com/items?itemName=Rubberduck.rubberduck-vscode
MIT License
602 stars 75 forks source link

A way to use RubberDuck to understand your entire codebase #31

Open rjohnson318 opened 1 year ago

rjohnson318 commented 1 year ago

Is this request related to a problem? Please describe.

N/A

Describe the solution you'd like

I would like to be able to ask questions and generate code in the same style as my current codebase. Including editing multiple files if that action required it.

Additional context

For example, I have a new service that I want to integrate into my codebase but that requires updating and creating of multiple files. If it understood the codebase then it would understand that and make all the appropriate changes instead of just a one-off generation where I then have to update or ask it for the next changes. I saw what could be the beginning of this with the work done here https://github.com/rubberduck-ai/repository-index

lgrammel commented 1 year ago

Repository index is aimed at bringing repository information into the prompt and give Rubberduck some codebase knowledge. That being said, I think the goal of having it understand patterns in your codebase is out-of-reach, at least in the short term.

lgrammel commented 1 year ago

There is now an experimental index repository command (needs to be enabled). It can be used together with your own templates (retrieval augmentation).

vinnn-90 commented 1 year ago

Hi, I am fairly new to programming and learning python with the help of ChatGPT. I am currently practicing on a repository with ~6 .py files and a .json file. I just wanted to mention that if I send a message to chatgpt containing the name and code of all files followed by my question, chatgpt is actually able to take all the files into account and understand the "connections"/imports etc.

It would be a great help for beginners like me if I could skip the copy/paste part and just create a list of files which code should be passed to the AI when starting a conversation or asking a question. Or if I could pose a question and direct the AI to read specific files before replying.

2214962083 commented 1 year ago

@lgrammel hey! maybe this can give you some inspiration

https://github.com/gannonh/gpt3.5-turbo-pgvector

restlessronin commented 10 months ago

@lgrammel I am thinking that one way to address this is to do something like what Github copilot does - pass as context all the files in open editors. Does that sound reasonable to you? If so, I can take a crack at implementing it.

trymeouteh commented 7 months ago

Cody AI does this and is very useful. To scan the entire workspace and not just a single file at a time.

Would like to see Rubberduck do this

I also made this feature request for a fork of this extension called Privy https://github.com/srikanth235/privy/discussions/27