I added the <returns>
xml tag to some of my methods but I can't see its content in IntelliSense.
Here is my code:
/// <summary> /// we all live in a yellow summary /// </summary> /// <returns>what it returns</returns> public int MyMethod() { .... }
Is there any way to show this content?
To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.
From the menu bar, choose Tools > Options to open the Options dialog box. Then, navigate to Text Editor > C# (or Visual Basic) > Advanced. In the Editor Help section, look for the Generate XML documentation comments option.
C# documentation comments use XML elements to define the structure of the output documentation. One consequence of this feature is that you can add any valid XML in your documentation comments. The C# compiler copies these elements into the output XML file.
The use of XML doc comments requires delimiters that indicate where a documentation comment begins and ends. You use the following delimiters with the XML documentation tags: /// Single-line delimiter: The documentation examples and C# project templates use this form.
This has been finally implemented in Visual Studio 2019 v.16.6.0, only a decade later :)
From the release notes:
This currently does not work (Visual Studio 2017), and is an open issue:
https://github.com/dotnet/roslyn/issues/31618
One way to make it work is to install the ReSharper Visual Studio plugin (but this is paid-for).
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