Discovering issues with code changes after committing changes can be frustrating. Fortunately, Visual Studio offers a new feature that helps you catch potential problems early, improving your code quality.
Visual Studio now includes a feature powered by GitHub Copilot that lets you review your local code changes before committing them, before they are part of your pull request. This can help identify performance and security issues early, ensuring you maintain a higher quality codebase.
How to Get Started
To use this feature, ensure your GitHub Copilot subscription is active and enabled within Visual Studio. If you don’t already have GitHub Copilot, you can sign up for free here.
You’ll need to enable the necessary feature flags:
- Tools > Options > Preview Features > Pull Request Comments
- Tools > Options > GitHub > Copilot > Source Control Integration > Enable Git preview features.
Then, you’ll see a new sparkle comment button in the Git Changes window. Clicking this button allows GitHub Copilot to review your local code changes and provide inline suggestions.
As always with AI powered features, you’ll want to review Copilot’s suggestions for accuracy, which you can do directly in your working file. You can navigate between comments or collapse them using the up arrow icon in the top right corner of the comment box. Please share your scenarios with us in the survey to help us make the comments as useful as possible.
Share your feedback
We rely on your user feedback to guide our roadmaps in Visual Studio. Please share your thoughts on this feature in this survey. Also, we’re already tracking a suggestion to improve this feature with customization, so share your thoughts here.
We value your continued support and insights to make your experiences in Visual Studio the best they can be, especially now with AI!