How to make Visual Studio intellisense to show the remarks portion of XML comments?
Asked Answered
C

2

16

When typing code, I really like the intellisense feature of Visual Studio 2010 (Professional), especially that I am able to look up XML comments of types in use. (See Documentation from Microsoft). This works so far. However, the remarks section of XML code comments does not show up.

I would consider this an extremely useful feature, since there is often useful information that can not get easily guessed from the summary. (Which is why we have a the remarks section, i guess)

How to explore the remarks portion in Visual Studio 2010 (Professional) at the intellisense level? (I use DevXpress Coderush, if that matters, but I don't think so).

Chronometry answered 27/12, 2011 at 14:31 Comment(5)
This could easily produce unwieldy IntelliSense tooltips. The <remarks> section is not intended to be displayed from IntelliSense, and instead to contain information that does not need to be immediately at hand. You can read the remarks from the Object Browser or the actual documentation that you generate automatically from the XML comments.Overuse
@CodyGray: Yeah, but I would have to search for the type in the object browser window. This is so annoying, considering, that I already have "determined in code" what type I want to have information on. Or did I overlook a feature in object browser like "track type on cursor" or something?Chronometry
The F12 key automatically shows the source (if available) of the selected object, or displays it in the Object Browser. (Well, actually, that depends on your selected VS settings. More info here.)Overuse
OK, that takes me to the comments... Consider to post that as answer. If there is no better solution, I will accept it.Chronometry
I wish there was an option to show remarks and return value description, if only because MS always fails to include essential information in the summary! The most typical case is whenever I encounter an unfamiliar collection class. For instance, the Dictionary<TKey, TValue> getter indexer (what a term!) throws an exception if the key doesn't exist, but the summary doesn't mention it - only the remarks do. HashSet<T>.Remove(T item) does not scream if the item does not exist (as one would expect given what hash sets are for, and the bool return value, but still). Stuff like that.Tabaret
C
3

Put your cursor over the class/function/whatever that you want to see the full comments on, then press F12. Expand the comments section on the left of the editor pane.

Cauline answered 21/2, 2013 at 22:23 Comment(6)
Thanks for your input. However, this is not what I was initially looking for, since I loose the current cursor position. I was looking for something to pop up while not leaving the editor.Chronometry
As was I. From an entire day of Googling, it looks like your only option is a custom piece put into resharper. I didn't look into that solution to far as that didn't work for me, mostly because I don't use resharper.Cauline
It's the best solution (well, the only) solution that is of help, thus accepting it.Chronometry
Ctrl <minus> takes you back to your previous cursor position :)Flipflop
The Resharper things is github.com/MrJul/ReSharper.EnhancedTooltipArchuleta
And this will not show you the remark but the remark-source. The source can include HTML entities whereas the remark "output" doesn't (well it correctly shows the characters of the entities e.g. "=&quot; | &=&amp; | <=&lt; | >=&gt; )Poree
M
5

Visual Studio v16.6.5 has an option in "Text Editor > C# > Advanced > Editor Help", called "Show remarks in Quick Info". It was added very recently and was enabled by default, but I haven't found any release notes or documentation about it. I checked version 16.5.2 and it does not have such an option.

When enabled, Quick Info shows the remarks section after adding a paragraph separator (empty line). When there is no summary section, the paragraph separator still gets added before the remarks (not sure if that's intentional).

The returns section is now also similarly shown, after the remarks section, separated by the word "returns". But there does not appear to be an option to disable this one.

Monstrosity answered 31/7, 2020 at 6:51 Comment(3)
This is VS2019, and I need to update first, as this seems to be indeed very new!Chronometry
I checked, and it's indeed there, enabled by default. So, this makes this question obsolete for the future. I will, however, not change the accepted answer, because the question explicitly refers to an older VS version. You might consider creating a new (wiki) question with this answer to garner your well-deserved reputation for this good spot.Chronometry
I'm 99% sure that VS 2019 used to show the remarks by default even before this option setting was added (but I don't think it ever showed "returns"). Then in the past week or so, I noticed that it was no longer showing; I found the setting & the checkbox was checked for me. I unchecked it then re-checked it, and the remarks started showing again...Reduplicate
C
3

Put your cursor over the class/function/whatever that you want to see the full comments on, then press F12. Expand the comments section on the left of the editor pane.

Cauline answered 21/2, 2013 at 22:23 Comment(6)
Thanks for your input. However, this is not what I was initially looking for, since I loose the current cursor position. I was looking for something to pop up while not leaving the editor.Chronometry
As was I. From an entire day of Googling, it looks like your only option is a custom piece put into resharper. I didn't look into that solution to far as that didn't work for me, mostly because I don't use resharper.Cauline
It's the best solution (well, the only) solution that is of help, thus accepting it.Chronometry
Ctrl <minus> takes you back to your previous cursor position :)Flipflop
The Resharper things is github.com/MrJul/ReSharper.EnhancedTooltipArchuleta
And this will not show you the remark but the remark-source. The source can include HTML entities whereas the remark "output" doesn't (well it correctly shows the characters of the entities e.g. "=&quot; | &=&amp; | <=&lt; | >=&gt; )Poree

© 2022 - 2024 — McMap. All rights reserved.