Skip to content

Incorrect formatting for simple lambda expression with comment #1147

@Rudomitori

Description

@Rudomitori

Input:

services.AddMetricsTrackingMiddleware(
    // Comment
    opts =>
    {
        opts.IgnoredHttpStatusCodes = Enumerable.Range(300, 9).ToArray();
    }
);

Output:

services.AddMetricsTrackingMiddleware(
    // Comment
    opts =>
{
    opts.IgnoredHttpStatusCodes = Enumerable.Range(300, 9).ToArray();
});

Expected behavior:

services.AddMetricsTrackingMiddleware(
    // Comment
    opts =>
    {
        opts.IgnoredHttpStatusCodes = Enumerable.Range(300, 9).ToArray();
    }
);

I sure this bug is caused by my changes in #1066. I totally forgot about cases with comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions