In Visual Studio, how do I change the default XML summary comment snippet from three lines to one line?
Currently it provides this snippet when I type ///
:
/// <summary>
///
/// </summary>
I would like this shorter snippet:
///<summary></summary>
My summaries are often brief and the extra 2 line are unnecessary.
Is there a configuration setting for this or some customizable code/custom addon to fix this.
This is an older question, but I liked Jason Williams's suggestion of creating a snippet for this, so I did. Not very complicated, but copy-and-paste is even easier :)
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Single line summary</Title>
<Shortcut>summary</Shortcut>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[/// <summary>$end$</summary>]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
You can change the shortcut by (probably obviously) changing the <Shortcut>
value.
Paste that into a new file named SingleLineSummary.snippet
and save it in the folder %USERPROFILE%\Documents\Visual Studio 2012\Code Snippets\Visual C#\My Code Snippets
(modify to fit your version of Windows and Visual Studio).
If you're not familiar with snippets, to use this just put the cursor above a method/property/etc, start typing summary
, and then hit TAB a couple of times.