R# code cleanup of comments different depending StyleCop plugin.

Jun 6, 2011 at 3:08 PM
Edited Jun 6, 2011 at 3:08 PM

I see different formatting during code cleanup, depending on whether the StyleCop plugin is installed or not.

 Disabled:

    /// <summary>
    ///     Class which represents ...
    /// </summary>
Enabled: 
    /// <summary>
    /// Class which represents ...
    /// </summary>

 I'm a bit confused by this.

Coordinator
Jun 6, 2011 at 6:06 PM

Why the confusion?

Leave the plugin installed and enabled.

Jun 6, 2011 at 6:09 PM
andyr wrote:

Why the confusion?

Leave the plugin installed and enabled.

I want to know where the spaces or being set/unset in the options.

Coordinator
Jun 6, 2011 at 6:11 PM

During CodeCleanup the StyleCop R# plugin reformats the xml headers - all of them.

Jun 6, 2011 at 6:13 PM

Thanks for your quick response!

So, I get that the plugin is reformatting ALL Xml Comments - what I'm trying to determine is exactly where the spaces in front of the comment is or is not being configured.

Turns out these spaces are now happening whether I have the plugin enabled or not, so it probably has nothing to do with it...

Jul 4, 2011 at 6:36 AM

I have experienced the same problem, and changing the CodeCleanup setting for any profile does not appear to make any difference - this is applied regardless, but only if the plugin is enabled.

Aug 18, 2011 at 11:25 AM

It seems that when the 'Reformat embedded XML doc comments' is enabled the Stylecop plugin inserts a tab at the beginning of every comment which is my opinion is wrong. It should just ensure that the comment starts with a space. Any chance of this being fixed ?

Coordinator
Aug 23, 2011 at 7:47 AM

Just so we're clear - I've just confirmed the behaviour in StyleCop 4.6.1.

With the plugin DISABLED

R# inserts muiltiple spaces so code goes from:

    /// <summary>
    /// Class which represents ...
    /// </summary>
to
    /// <summary>
    ///     Class which represents ...
    /// </summary>

and when you ENABLE the plugin:

    /// <summary>
    ///       Class which represents ...
    /// </summary>
to
    /// <summary>
    /// Class which represents ...
    /// </summary>

This is expected behaviour.