The Visual Studio 17.14 GA release and recent C# Dev Kit releases for VS Code have introduced a whole new batch of GitHub Copilot features designed to make your .NET development experience a more efficient and delightful one! Let’s look at some of the latest updates!
Agent mode, MCP, and more
The overall AI assisted development experience has seen huge improvements recently. From agent mode in Visual Studio, VS Code, and other editors to MCP support to next edit suggestions and beyond. Each of these features was designed to boost your day to day development experience with your powerful pair programmer copilot.
Improved Context Awareness in VS and VS Code
Have you ever received a code suggestion from GitHub Copilot that seems to be unaware of your project and doesn’t reflect your codebase? The .NET team is addressing this issue by providing added context to GitHub Copilot for each query, now available in Visual Studio 17.14 and VS Code with C# Dev Kit. It will now scan your code for supported coding scenarios that Copilot can store for better context, resulting in more consistent, relevant responses. Supported scenarios include the following:
- If overriding a method or implementing an interface member, locate an example from a sibling type.
- If in a method body, locate a caller as an example for how the method is used.
- If in a member access context and can confidently resolve it to a symbol, find other references to this symbol and return code around it as an example.
We’ll be adding more scenarios to the context awareness provider soon!
Microsoft Learn Integration for Up-to-Date Responses in VS
.NET is constantly being updated and improved on…but the models used by Copilot are trained using data from a certain point in time. When you ask Copilot questions about something that was released after the model was trained, it can provide you with unverified or out-of-date information. With the new MS Learn Integration, now available in VS 17.14, when you ask Copilot about a topic it doesn’t know, it will pull info from existing MS Learn docs to provide you with the most up to date information!
To enable this feature, go to Tools > Options > Copilot > Feature Flags > Enable Microsoft Learn Function in chat. You’ll also need to be logged in with a Microsoft account in VS to use this feature, but GitHub authentication support is on the way!
Implement Your Methods with Copilot in VS
Two popular refactorings many .NET developers use are Implement Method and Implement Interface, both of which let you automatically generate methods that are referenced but not implemented yet. In VS 17.14, once you’ve used the one of these refactorings, you can select the lightbulb (CTRL + .
), and choose the new Implement with Copilot refactoring, which will add the body to your method!
On-the-Fly Documentation in VS
Sometimes, you are scrolling through code that you didn’t write or need a refresher on, and you just want a quick description of the variable, method, or class and what it does. Now, when you hover over a variable, method, or class and pull up its Quick Info tooltip in VS, you will see an option to Describe with Copilot. If you select that option, you will receive a Copilot-generated summary of that element for as long as you hover over it. This gives you a quick and temporary way to view information about your codebase.
Auto-Generate Documentation Comments in VS
If you want more permanent comments for your classes and methods, GitHub Copilot does that work for you! In VS 17.14, when you add the doc comment notation (///
) to the top of your class or method, GitHub Copilot will generate the full comment, complete with summary and descriptions for each parameter! This will appear as ghost text. Just hit tab to accept it!
Summary
We’ve introduced a lot of Copilot-powered features to improve your productivity, and we want to hear your feedback on how we can make them even better! Please try them all out, share your feedback in the Developer Community, and stay tuned for even more updates!
0 comments
Be the first to start the discussion.