locked
Rapidly Stub out Code & Comments RRS feed

  • Question

  • Hello,

    Awhile ago I met a developer who had frequent code stubs and xml comments somehow integrated to Visual Studio. It was not a situation where I could ask him to stop and teach me the cool trick but I was hoping some of you might now how or what add-in he used.

    It was LIKE (but I don't think it was a macro) he had a list of buttons on a fly-out menu for "Method Comments", "Class Comments" etc. He simply positioned cursor then clicked button and viola all the company mandated XML minimum commenting was added as a stub. He then simply added the text.

     For example a single click of the property XML Comment button would generate:

    ///

     

    <summary>Property Summary Here</summary>

     

    /// <remarks>What was the idea / plan here</remarks>

     

    /// <permission>Public Property in a public class accessible to all</permission>

     

    /// <value>string</value>

     

    /// <returns> Gets/ Sets string value</returns>

     

    /// <exception>No anticipated / handled exceptions</exception>

     

    /// <example>If you need an example go back to school</example>

     

     

     

    Any ideas or something similiar would be appreciated.

    Thursday, February 18, 2010 11:53 AM

Answers

  • It sounds like Code Snippets (given I use them for exactly the same thing!) and it's quite possible the flyouts you saw were just IntelliSense. This doesn't require any Addins.

    Here's the link to get you started:

    http://msdn.microsoft.com/en-us/library/f7d3wz0k(VS.80).aspx

    Cheers,

    Graham

    • Proposed as answer by Grey Ham Thursday, February 18, 2010 12:59 PM
    • Marked as answer by Chao Kuo Wednesday, February 24, 2010 1:40 AM
    Thursday, February 18, 2010 12:59 PM
  • To automatically generate those kind of comments you could use GhostDoc (http://submain.com/products/ghostdoc.aspx ). A free plugin to generate documentation. You usually use it by placing the cursor on the method/property/etc you want to document and hit a shortcut key, so it fits your description.

    Also it could be a mixture of GhostDoc and the Code Snippets mentioned by Grey. Code Snippets are fairly common. Say, you want to create a new property. Just place the cursor on the appropriate position, type "prop" and hit the Tab key twice. Also hitting Ctrl-K Ctrl-X opens up a small popup with a list of code snippets for you to choose from.
    • Proposed as answer by Chao Kuo Tuesday, February 23, 2010 3:11 AM
    • Marked as answer by Chao Kuo Wednesday, February 24, 2010 1:40 AM
    Thursday, February 18, 2010 2:23 PM

All replies

  • It sounds like Code Snippets (given I use them for exactly the same thing!) and it's quite possible the flyouts you saw were just IntelliSense. This doesn't require any Addins.

    Here's the link to get you started:

    http://msdn.microsoft.com/en-us/library/f7d3wz0k(VS.80).aspx

    Cheers,

    Graham

    • Proposed as answer by Grey Ham Thursday, February 18, 2010 12:59 PM
    • Marked as answer by Chao Kuo Wednesday, February 24, 2010 1:40 AM
    Thursday, February 18, 2010 12:59 PM
  • To automatically generate those kind of comments you could use GhostDoc (http://submain.com/products/ghostdoc.aspx ). A free plugin to generate documentation. You usually use it by placing the cursor on the method/property/etc you want to document and hit a shortcut key, so it fits your description.

    Also it could be a mixture of GhostDoc and the Code Snippets mentioned by Grey. Code Snippets are fairly common. Say, you want to create a new property. Just place the cursor on the appropriate position, type "prop" and hit the Tab key twice. Also hitting Ctrl-K Ctrl-X opens up a small popup with a list of code snippets for you to choose from.
    • Proposed as answer by Chao Kuo Tuesday, February 23, 2010 3:11 AM
    • Marked as answer by Chao Kuo Wednesday, February 24, 2010 1:40 AM
    Thursday, February 18, 2010 2:23 PM