Introducing automatic documentation comment generation in Visual Studio

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.

Gif showcasing copilot generating a summary in the comments

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.

Tools > Option, Coding Style, General to enable for C++

For C#, you would need to enable the following setting in your Tools > Options

Tools > Option, C#, Advanced, Comments for C#

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!

The post Introducing automatic documentation comment generation in Visual Studio appeared first on Visual Studio Blog.

Previous Article

Visual Studio at GDC 2025

Next Article

Optimizing Build Times with Build Insights: How Activision Cut Call of Duty’s Build Time by 50%

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *