How to automatically generate comments in Visual S

2020-05-25 04:33发布

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?

5条回答
你好瞎i
2楼-- · 2020-05-25 05:06

You can use Ghostddoc to generate alot of your xml comments: http://submain.com/products/ghostdoc.aspx

I think there is a free version available.

查看更多
一夜七次
3楼-- · 2020-05-25 05:09

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).

查看更多
三岁会撩人
4楼-- · 2020-05-25 05:09

Use "///" instead of "//" for comments. For example, the following comment was auto-generated by just starting to type "///":

/// <summary>
/// </summary>
/// <param name="terms"></param>
public TVec(IEnumerable<Term> terms)
{
}
查看更多
放荡不羁爱自由
5楼-- · 2020-05-25 05:12

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.

查看更多
Ridiculous、
6楼-- · 2020-05-25 05:12

Try typing "///" one line ahead of a method. Tell me if that is what you are looking for.

查看更多
登录 后发表回答