microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
331 stars 31 forks source link

Feature Request: Implement File Referencing for Code Modifications #1127

Open rajeshkanaka opened 6 months ago

rajeshkanaka commented 6 months ago

Feature Description: The ability for GitHub Copilot to accept file references when suggesting code modifications would significantly enhance its utility for developers. This would enable Copilot to understand the broader context of a project and provide more tailored, accurate suggestions.

Use Cases: Modifying code that depends on other files: Copilot could intelligently suggest changes in the current file based on the contents and structure of referenced external files. Refactoring across multiple files: Users could provide a list of relevant files to Copilot, enabling it to propose coordinated refactoring actions across the project. Working with larger codebases: In complex projects, referencing files would help Copilot maintain focus and provide more relevant suggestions.

Competitor Analysis: Coding assistants like Cursor AI already offer robust file referencing capabilities. Implementing a similar feature in GitHub Copilot would maintain its competitiveness and offer greater value to developers.

Developer Impact This feature has the potential to streamline development workflows, reduce manual refactoring efforts, and improve the overall accuracy and relevance of Copilot's suggestions.

Request:

I strongly believe that adding file referencing functionality would make GitHub Copilot an even more powerful and essential tool for developers. Please consider prioritizing this feature in your development roadmap.

aeschli commented 6 months ago

When you are in the panel chat, you can already give a list of interesting files using the #file variable. The reply might suggest a change in these files. In inline chat (opened with Ctrl+i in an editor) we don't support that yet, but it's planed.

nick-noaa commented 6 months ago

I have to agree with @rajeshkanaka. The ability for GitHub Copilot to have a consistent understanding of our project structure and other relevant details before each session would significantly enhance its usefulness.

While I appreciate the privacy concerns, it's worth noting that ChatGPT 3.5 already incorporates a similar feature.

The # commands for file, selection, editor, and terminal are incredibly useful and I use them frequently.

In the meantime, I've devised a workaround. At the start of each session, I provide a .txt file (using the # + file command) that contains the information I want GitHub Copilot to be aware of. However, the information seems to be forgotten quickly, requiring me to provide it again.

Despite this, I'm a big fan of the service. BUT! If this feature were to be implemented, it would truly be a game-changer for devs using copilot!

Thank you for considering this suggestion.