XML Auto Commenting C# in Visual Studio Code

s2Jakob picture s2Jakob · Dec 14, 2015 · Viewed 20.2k times · Source

In MonoDevelop, when I type "///", it auto-generates an xml-style comment like this:

/// <summary>
/// Describes the variable x
/// </summary>
int x = 0;

Is there a way to get this behavior in Visual Studio Code?

Answer

Keisuke KATO picture Keisuke KATO · Jan 6, 2016

This feature is not available out-of-the-box with VS Code, but like most features is available via third-party extensions. As of the time of this answer, here is a popular extension that provides some XML comments support to VS Code:

C# XML Documentation Comments Support for Visual Studio Code

If that extension doesn't work for you, you may be able to find alternatives by searching the VS Code Marketplace