dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

Home Page:https://josefpihrt.github.io/docs/roslynator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflict between `RCS0009` and `RCS0036` for auto-properties with documentation

BodrickLight opened this issue · comments

Product and Version Used:
Roslynator.Analyzers v4.12.2
Roslynator.Formatting.Analyzers v4.12.2

Steps to Reproduce:

  1. Create a class with documented auto-properties.
  2. RCS0036 is raised to remove blank lines between single-line declarations of the same kind
  3. Apply an auto-fix - the blank line is removed
  4. RCS0009 is raised to add a blank line between declaration and documentation comment
  5. Apply an auto-fix - the blank line is added
  6. goto 2

Actual Behavior:

public class TestClass
{
    /// <summary>
    /// x.
    /// </summary>
    public int A { get; set; }
                                   /* <-- RCS0036 raised here incorrectly */
    /// <summary>
    /// x.
    /// </summary>
    public int B { get; set; }
    public int C { get; set; }
    public int D { get; set; }
}

public class TestClass
{
    /// <summary>
    /// x.
    /// </summary>
    public int A { get; set; }     /* <-- RCS0009 raised here correctly */
    /// <summary>
    /// x.
    /// </summary>
    public int B { get; set; }
    public int C { get; set; }
    public int D { get; set; }
}

Expected Behavior:

public class TestClass
{
    /// <summary>
    /// x.
    /// </summary>
    public int A { get; set; }

    /// <summary>
    /// x.
    /// </summary>
    public int B { get; set; }
    public int C { get; set; }
    public int D { get; set; }
}