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

SA1503 code fix indents incorrectly with custom indentation size #3581

Open
bjornhellander opened this issue Nov 27, 2022 · 0 comments
Open

Comments

@bjornhellander
Copy link
Contributor

Consider the following file:

namespace TestNamespace
{
 public class TestClass
 {
  public void TestMethod(int i)
  {
   if (i == 0)
    return;
  }
 }
}

If this is included in a project with settings.indentation.indentationSize=1, then the code fix for SA1503 provides the following incorrect fix:

namespace TestNamespace
{
 internal class TestClass
 {
  public void TestMethod(int i)
  {
   if (i == 0)
            {
                return;
            }
        }
 }
}

StyleCop.Analyzers 1.2.0-beta.435.
Visual Studio 17.4 (Roslyn 4.4.0). Does not happen in earlier versions.
dotnet/roslyn#63013 filed on earlier preview version of Roslyn, but the same applies for 4.4.0.
PR #3580, created to bump Roslyn version to 4.4.0 in the c#11 test project, fails because of the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant