Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto linewrap comments in .NET?

I'd like to have a single command to auto-linewrap the XML-style comments in .NET.

Example:

/// <summary>
/// This comment line should be
/// on one line, and other lines in this <summary> block should be wordwrapped.
/// </summary>

I wouldn't mind buying some of the commercial Visual Studio plugins, if they are capable of doing this.

like image 485
Contango Avatar asked Oct 02 '11 10:10

Contango


People also ask

How do I auto generate comments in Visual Studio?

The only way I know to do this is on the line right above your method just type "///" and it will generate a comment template based on the method.

How do you wrap text in VS 2022?

Under Settings, select or clear the Word wrap option. When the Word wrap option is selected, the Show visual glyphs for word wrap option is enabled. The Show visual glyphs for Word Wrap option displays a return-arrow indicator where a long line wraps onto a second line.

How do I wrap code in Visual Studio?

wordWrap": "on" You can toggle word wrap for the VS Code session with ⌥Z (Windows, Linux Alt+Z).


1 Answers

Try the trial of ReSharper, it states it formats XML Doc Comments (Go Here and search for XML doc comments for more information) and tends to be very customisable.

If that doesn't work, the closest thing I could find was on CodeProject , it's intended for Visual Studio 2003; however is open source so you may be able to get it working without the expensive of a third party plugin.

like image 66
Luke Merrett Avatar answered Sep 19 '22 17:09

Luke Merrett