Is there a VS shortcut to automatically update triple slash comments when adding a new parameter to a method signature?

Visual Studio's auto-documenting feature allows you to enter three slashes ('///') before the method to automatically generate XML-style documentation stubs, for example:

/// <summary> /// /// </summary> /// <param name="bar"></param> /// <param name="baz"></param> /// <returns></returns> public int foo(bool bar, string baz) { return 0; } 

If I edit the signature and add a new parameter, is there a key combination for updating comments by adding a new line with the <param ...> ?

UPDATE: This feature is officially called “Smart Comment Editing,” and the full documentation for it is contained in the MSDN Programmer’s Guide under “ XML Documentation Comments ” ( Separators ). There is no mention of any “update” function, so the answer to this question is apparently “No”.

+7
c # visual-studio-2012 keyboard-shortcuts
source share
1 answer

I have not seen this functionality in Visual Studio, but certainly in R # ReSharper (I am currently running 8.2 C # Edition).

Depending on your R # settings, you will get a red curve under the variable name with an explanation:

  Parameter 'foo' has no matching param tag in the XML comment for Class1.Bar (but other parameters do) 

Then you have the R # options, for example:

  Add xml-doc comments 

Hope this helps. If you are not currently using R #, you will find many other great features / benefits and is worth its weight in gold :-)

+3
source share

All Articles