views:

67

answers:

2

Is there a built-in command or tool that can reflow C# comments in Visual Studio?

Sometimes, a section of code requires several lines of comments, and after extensive editing you have to manually insert the line breaks in the appropriately places so that it does not flow past the right edge of your editor window. I'd like to be able to do this with a single key command.

After many years of using Visual Studio I still miss the ability to M-q (c-fill-paragraph) in emacs.

Edit: The Agent Smith plugin does not reflow comments in the method body.

+1  A: 

If you are using ReSharper, there is the free Agent Smith plugin that can reflow comments.

Bojan Resnik
Thanks, I tried it out. Agent Smith is able to reflow the XML comments (the '///' comments preceding a member) but not comments inside a member. I think this will be fixed this at some time.
Phillip Ngan
A: 

Back when I was a Visual C++ Developer I wrote a fairly configurable comment formatting tool called Comment Reflower. I have since changed platforms and so stopped doing ports, but thankfully Christoph Nahr has kept it alive at http://www.kynosarges.de/CommentReflower.html

Ian Nowland