When I hit /// in Visual Studio, is it possible to change the resulting snippet from this:
/// <summary> /// /// </summary>
to this?:
/// <summary></summary>
To create or edit your own snippets, select User Snippets under File > Preferences (Code > Preferences on macOS), and then select the language (by language identifier) for which the snippets should appear, or the New Global Snippets file option if they should appear for all languages.
An XML comment encountered outside the document type declaration is represented by the Comment value syntax element. It contains the comment text from the XML message. If the value of the element contains the character sequence --> , the sequence is replaced with the text --> .
The XML editor offers a feature, called XML snippets, that allows you to build XML files more quickly. You can reuse XML snippets by inserting them into your files. You can also generate XML data based on an XML schema definition language (XSD) schema.
Here is the solution working in at least VS2010.
Save the bottom code as a file summ.snippet.
Visual Studio 2010 / Tools / Code Snippet Manager
Click import, browse to file. Save with default options.
Now goto your code window and type summ + tab + tab
Result
/// <summary> </summary>
with the cursor in the middle of the tag, ready to type.
Here is the contents of the summ.snippet
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>Summary - inline</Title> <Description>Created inline summary comment tag</Description> <Author>Mike Vanderkley</Author> <Shortcut>summ</Shortcut> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Code Language="csharp"> <![CDATA[/// <summary> $end$ </summary>]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
It appears to me that what the /// generates is coded in: Macros.Samples.Utilities.InsertDocComments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With