Comments wrap with StyleCop and R# 6.1.1

Feb 23, 2012 at 12:14 PM

I just updated to latest resharper and stylecop, but I'm seeing one issue. When doing code cleanup my documentation is not wrapped. It is just very long one line text. Even when I manually wrap it after next cleanup it again going into one big line.

Coordinator
Feb 23, 2012 at 3:19 PM

Theres a settings in the StyleCop options page to keep them on one line or force them to newlines.

Feb 24, 2012 at 10:05 AM

Sorry, for bothering, but I cannot find this option.

Kind Regards

Mar 13, 2012 at 3:01 PM
Edited Mar 13, 2012 at 3:01 PM

I searched many times already in StyleCope and Resharper Settings and sitll cannot find this option.

Mar 23, 2012 at 11:07 PM

I'm experiencing this too.  I have a multiline summary like so...

/// <summary>
///    Long line 1.
///    Long line 2.
/// </summary>

And no matter what options I choose in the R# StyleCop plugin settings-- both on the plugin settings page and the StyleCop code cleanup settings-- my comment gets reformatted to this:

/// <summary>
///    Long line 1. Long line 2.
/// </summary>

The total line length is 170 characters after the reformat, and R# is set to wrap at 140.  Is there a way to stop this from happening?

Coordinator
Mar 23, 2012 at 11:15 PM
Edited Mar 29, 2012 at 5:12 PM
Hi. Yes. I found this very problem today too. There's a setting in the code cleanup where you tell r# to not reformat xmldo comments. Turn that off and you'll be fine. Next release of stylecop will turn it off for you if you reset code style settings.
A.

 

Mar 26, 2012 at 6:59 PM

Hey Andyr--

First off I want to thank you for all your great work.

I have a variant of this issue.  Even when I have the R# settings to not reformat xml docs stylecop seems to reformat my code as follows:

After running code cleanup:

/// <summary> Element - element description
/// </summary>

This only happens when the Stylecop add-in is running.

/// <summary>
/// Element - element description
/// </summary>

I prefer that the comment appear directly after the opening tag so that the comment is visible when outlining is collapsed.  I haven't seen anything in style cop rules that requires the new line.

It would be great if stylecop didn't do this format.

Thanks for your attention.

Regards,

Chris



Coordinator
Mar 26, 2012 at 7:05 PM
Edited Mar 29, 2012 at 5:12 PM
Hi
There is a setting in ReSharper - Options - Stylecop that can do this for you now.
A. 
Mar 26, 2012 at 8:23 PM

Oops--

Thanks so much, you are right.  I completely blew by that.

Regards,

Chris