We are excited to announce that Copilot is now automatically integrated into Visual Studio’s editor to help you generate doc comments for functions. This new feature aims to streamline your documentation process and enhance your coding experience.
To access these updates, you will need a GitHub Copilot subscription. If you don’t already have GitHub Copilot, you can sign up for free here.
AI doc comment generation
If you have automatic doc comment generation enabled via your settings, you can simply type what would trigger your doc comment format (such as ///) and Copilot suggestions will automatically fill out the function description based on the contents of the function, including a summary and any parameters and return types (if available). You can then accept these suggestions using a single tab, just like regular Copilot code completions.
How to enable doc comments
To access this feature, you will need to have automatically generating doc comments enabled.
For C++ projects, you can configure the generated documentation comment styles using the following setting in Tools > Options. Both XML and Doxygen style comments are supported by this feature.
For C#, you would need to enable the following setting in your Tools > Options
Share your feedback
This feature is available for Visual Studio 17.14 Preview 2 for both C# and C++ project files. We encourage you to explore this feature and see how GitHub Copilot can transform and simplify your coding experience.
We deeply appreciate the continuous feedback from our users, which drives us to improve and innovate. Your input is invaluable in making Visual Studio better with each update. Happy coding!