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>
{
    BondsMonth,
    BondsIdCode,
    //                BondsBondTaken,
    //                // BondsPayments0,
    BondsPaidBackStatus,
});
  • 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?

2 comments

Hi,

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

Thanks!

0

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

0

Please sign in to leave a comment.