Skip to content

Reformatting does not consistently indent comment and succeeding statement #25010

@jnm2

Description

@jnm2

15.5.7 without ReSharper enabled

To repro, start with something like the following in the editor:

using System;

public static class Program
{
    public static void Main()
    {
            Action x = () =>
            {
                // Comment
                var a = 1;
                var b = 2;
            };
    }
}

Select the last semicolon (line 12) and retype it to trigger reformatting. Result:

using System;

public static class Program
{
    public static void Main()
    {
        Action x = () =>
        {
                // Comment
                var a = 1;
            var b = 2;
        };
    }
}

Metadata

Metadata

Assignees

Labels

Area-IDEBugIDE-FormatterCode formatter and/or smart indenthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

Status

Completed

Relationships

None yet

Development

No branches or pull requests

Issue actions