remove extra spaces in comments with resharper cleanup / reformat

I often comment lines,
but if the line is indented (almost always) then it leaves ugly whitespace inside the comment, like so:

Headers.Add(new List<string>
    //                BondsBondTaken,
    //                // BondsPayments0,
  • I looked through Resharper C# Code Editing options, but could not  find an option to make code cleanup / reformatting remove those  additional spaces?
  • Or is it possible to make the comment shortcut / function remove more than 1 space in the first place?

Comment actions Permalink


Do you have StyleCop installed? I beleive ReSharper itself has no such formatting option there.
Please let me know.


Comment actions Permalink

Thanks, StyleCop does it beautifully and even integrates with Resharper Code Cleanup out-of-the-box!
The only undesirable side-effect is that cleanup has become much slower, probably due to the plethora of rules StyleCop evaluates / fixes.


Please sign in to leave a comment.