如何让Visual Studio显示异常的完整文档?

时间:2018-02-06 07:15:30

标签: c# visual-studio visual-studio-2013 resharper-8.0

我正在使用Visual Studio 2013和ReSharper 8.2.3。

在代码编辑器中,VS将在弹出框中显示光标下标识符的一些信息。此信息取自标识符源程序集中包含的Xml API文档。

不幸的是,那里似乎缺少关于异常的文档。因此,调用以下类的单个方法:

public static class ExampleClass
{
    /// <summary>
    /// Does something.
    /// </summary>
    /// <param name="text">The text to process.</param>
    /// <returns>The result.</returns>
    /// <exception cref="ArgumentNullException"><paramref name="text"/> is <see langword="null"/>.</exception>
    /// <exception cref="ArgumentException"><paramref name="text"/> is longer than 50 characters.</exception>
    public static Int32 DoSomething(String text)
    {
        if (text == null)
        {
            throw new ArgumentNullException("text");
        }
        if (text.Length > 50)
        {
            throw new ArgumentException("The text is too long.");
        }

        return 42;
    }
}

将导致以下弹出窗口:

popup without exception documentation

显然,对我来说,知道有时并不是很有帮助,该方法可能会抛出ArgumentException。因此,我仍然需要找到所述类的来源以查看Xml文档。

可以更改ReSharper或Visual Studio中的某些设置,以便这些工具提示显示整个异常信息吗?

不幸的是,升级工具版本目前不适合我们。

此问题与How to add documentation tooltip to classes, methods, properties, etc. in C#?不重复。事实上,我说它只是勉强相关。是的,它也指C#和Xml代码文档。但是,链接的问题询问如何标记注释,以便C#编译器和IDE将它们作为Xml API文档处理。相比之下,这个问题询问如何配置Visual Studio以在Xml API文档中提供的代码编辑器工具提示中显示某些信息,但这些工具提示中缺少这些信息。

0 个答案:

没有答案