In the latest Visual Studio Code release, you will find a suite of enhancements to GitHub Copilot, designed to make your coding and debugging experience in VS Code more productive and efficient. These features are now available for you to try out in the latest version of Visual Studio Code.
To give you suggestions and edits, Copilot collects information from your codebase. To give you even more specific and relevant responses, you can provide additional context to guide and focus Copilot. In this release, we’ve added more ways to add context for Copilot Chat and Copilot Edits.
You can now add symbols to the context to provide very detailed and specific context. Drag and drop a symbol from the Outline view or editor breadcrumb in the Chat view, or reference a symbol by typing #sym
in the chat input field.
You can also add folders to the context to provide a broader context. Drag and drop a folder from the Explorer view into the Chat view to add all files in that folder to the context.
More efficient multi-file editing
With Copilot Edits (preview), you can get edit suggestions across multiple files in your project. We’ve made several enhancements to Copilot Edits to make the experience more efficient and easier to use.
- Editor overlay controls: The overlay controls in the editor enable you to quickly navigate between suggested edits, review, and apply them. As Copilot Edits is generating edits, the overlay controls will show a progress indicator.
-
Move chat conversation to Copilot Edits: You might use Copilot Chat to explore ideas for making code changes. Instead of applying individual code blocks from chat, you can now move the chat session to Copilot Edits to apply all code suggestions from the session.
-
Working set: For large codebases, it can be hard to add the right files to the working set. VS Code can now suggest relevant files to add to the working set, so you get the most relevant edits across your project. And to make adding to the working even more efficient, drag files from the Explorer view or Search view to add them to the working set.
-
Restore edit sessions: Copilot Edits now saves and restores your edit session across VS Code restarts, so you can continue where you left off.
Kickstart debugging with copilot-debug
Setting up a debugging environment can be challenging, especially when you’re working with a new codebase or project. With the new copilot-debug
terminal command, you can ask Copilot to generate a launch configuration for you based on your project’s setup. And if your project needs a compilation step before debugging, Copilot can generate a task for that too.
Customize commit-message generation
Setting: github.copilot.chat.commitMessageGeneration.instructions
Copilot can help you generate commit messages based on the changes you’ve made. In this release, we added support for custom instructions when generating a commit message. For example, if your commit messages need to follow a specific format, you can describe this in the custom instructions.
Use the github.copilot.chat.commitMessageGeneration.instructions
setting to either specify the custom instructions directly, or to specify a file from your workspace that contains the custom instructions. These instructions are appended to the prompt that is used to generate the commit message. Get more information on how to use custom instructions.