Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between RCS0009 and RCS0036 for auto-properties with documentation #1465

Closed
BodrickLight opened this issue May 9, 2024 · 0 comments · Fixed by #1466
Closed

Conflict between RCS0009 and RCS0036 for auto-properties with documentation #1465

BodrickLight opened this issue May 9, 2024 · 0 comments · Fixed by #1466
Assignees

Comments

@BodrickLight
Copy link

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; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants