Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R#: Stop it touching ghostdoc XML comments on Code Cleanup?

I am using GhostDoc to create my XML comments and I am very happy with the format. I use the following format (c#)

    /// <summary>
    /// Creates new client.
    /// </summary>
    /// <param name="uri">The URI.</param>
    /// <param name="param">The param.</param>
    /// <returns></returns>

Using the code cleanup from R# 7.1.1 it reformats my xml comments, it even inserts new xml comments where there were missing, its really annoying. Is there a way to stop this.

I have created my own profiles for code cleanup and DISABLED everything (even the stylecop settings too) and I do a code cleanup and sure enough it wants to reformat my xml comments and place new ones where they were missing..

Anyone know how to get around this?

Thanks

like image 431
Martin Avatar asked Sep 12 '25 05:09

Martin


2 Answers

Most likely you are doing something wrong or you've hit a bug either in ReSharper or in StyleCop. You should:

  1. Try to disable StyleCop completely.
  2. Double check that you've disabled C# | Reformat embedded XML doc comments in your custom profile.
  3. Double check that you are indeed selecting this custom profile when invoking code cleanup.
  4. Create a sample solution where problem can be reproduced and contact ReSharper support. See http://www.jetbrains.com/support/resharper/
like image 88
Dmitry Osinovskiy Avatar answered Sep 14 '25 18:09

Dmitry Osinovskiy


I was having a similar problem. I used GhostDoc and R# Code Cleanup kept turning this

/// <summary>
/// Defines the entry point of the application.
/// </summary>
/// <param name="args">The arguments.</param>

into this

/// <summary>
/// Defines the entry point of the application.
/// </summary>
/// <param name="args">
/// The arguments.
/// </param>

It was infuriating because I had Reformat embedded XML doc comments deselected. I finally found the offending setting at ReSharper->Options->Code Cleanup->StyleCop->1611: Element Parameters Must Be Documented. I unchecked that, and it stopped screwing up my formatting.

You should be able to follow a similar approach with your own issues, substituting "Parameters" with whatever your problem is.

like image 34
Travis Avatar answered Sep 14 '25 18:09

Travis