我可以使用ReSharper生成类和方法摘要吗 [英] Can I generate class and method summaries with ReSharper

查看:133
本文介绍了我可以使用ReSharper生成类和方法摘要吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方便的方法来生成C#中的类或方法摘要的存根。像这样的示例摘要:

I need a convenient way to generate stub of class or method summary in C#. Like this sample summary:

public class TestClass
{
    /// <summary>DoWork is a method in the TestClass class. 
    /// <para>Here's how you could make a second paragraph in a description. <see cref="System.Console.WriteLine(System.String)"/> for information about output statements.</para>
    /// <seealso cref="TestClass.Main"/>
    /// </summary> 
    public static void DoWork(int Int1)

我找不到这样的功能开箱即用,在ReSharper中。我认为它具有重构功能,但是它们似乎没有宣传它。

I wasn't able to find such feature out of the box in ReSharper. I assume it's refactoring functions would have it but they don't seem to advertise it.

也许是因为开箱即用的Visual Studio可以生成它吗?在那儿?将摘要添加到类或方法的便捷方法是什么?

Perhaps because Visual Studio out of the box has a shortcut to generate it? Is there? What is the convenient way to have the summary added to the class or method?

推荐答案

如果已将项目设置为生成XML文档,R#将提供为公共成员生成XML注释的选项。

If you have set your project to generate XML documentation, R# will offer the option to generate XML comments for public members.

如果您想要一些可以从类和方法名推断文本文档的东西,那么GhostDoc是您的选择

If you want something that infers textual documentation right from class and method names, then GhostDoc is your thing.

如果您想为每种方法生成相同的结构,只需定义相应的实时模板或VS代码段即可。

If you want to generate the same structure for each method, simply define a corresponding Live Template or VS snippet.

这篇关于我可以使用ReSharper生成类和方法摘要吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆