From Eclipse I'm used that when I start typing a comment for a class or method, the parameters, return types and exceptions are autogenerated. But in VisualStudio 2010 I can't find something like this. Any hints how to achieve that?
Do one of the following: Type /// in C#, or ''' in Visual Basic. From the Edit menu, choose IntelliSense > Insert Comment. From the right-click or context menu on or just above the code element, choose Snippet > Insert Comment.
Multi-line comments start with /* and ends with */ . Any text between /* and */ will be ignored by C#.
A comment is preceded by an double forward slash. The code of line after the double forward slash is simply ignored by the compiler. To code a comment, type an double forward slash followed by the comment. You can use this technique to add a comment on its own line or to add a comment after the code on a line.
The only way I know to do this is on the line right above your method just type "///" and it will generate a comment template based on the method.
GhostDoc is a free extension that will do this. Just hit (by default) Ctrl+D anywhere within a method, and it will add XML Documentation comments with defaults filled in (though they typically should be modified/expanded).
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