Is there a good way to display long XML comments in Visual Studio without going to the definition?

Tooltips that show comments are convenient, but for long comments, the tooltip becomes useless because it lasts only a few seconds and the comment stretches along one line until it ends.

You can go to the comments by going over to the definition, but it’s annoying because it opens tabs for the source files that I don’t work on and messed up the forward / backward navigation history. Also, the problem is that you are looking at XML (which should be escaped ) instead of well-formatted documentation.

What I really would like to see is how Eclipse displays javadoc comments. This blog post shows a comparison for tooltips of similar classes in Visual Studio and Eclipse.

Is there such a mode or plugin for Visual Studio?

+4
source share
2 answers

You can put your xml comments on multiple lines with a <para> . Thus, your long comments will not go off the screen:

 /// <summary> /// <para>First line of your comment</para> /// <para>Second line of your comment</para> /// </summary> 

About the delay for these tooltips; it was a long request for Visual Studio, which has not yet been fixed. It was recently requested here , and back in 2004 here .

+2
source

I use GhostDoc to automatically generate XML comments for my code, this is especially useful since you don't spend too much time re-generating comments, and this helps make the API information understandable.

A couple of ideas:

You can use the hyperlink in the comment, as shown in the image below. This may indicate a help system:

enter image description here

You can use this in conjunction with SandCastle , here is a great article Creating documentation for a Net component using Builder Builder :

By default, an XML file is created from comments. It should be included in the project properties on the Build tab.

enter image description here

As a result, an XML file will be created each time you build your executable or assembly. This file will contain all the XML comments from the code, including comments for all non-public objects. This file is useful in itself, because when you put it next to the assembly, the IntelliSense function in Visual Studio will use the information from this file that displays descriptions of methods, properties and assembly parameters. Here is an example of how he will look for the GetR function shown above:

enter image description here

0
source

All Articles