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

Incorrect formatting for simple lambda expression with comment #1147

Open
Rudomitori opened this issue Jan 24, 2024 · 1 comment
Open

Incorrect formatting for simple lambda expression with comment #1147

Rudomitori opened this issue Jan 24, 2024 · 1 comment
Milestone

Comments

@Rudomitori
Copy link
Contributor

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

@belav belav added this to the Planned milestone Jan 31, 2024
@belav
Copy link
Owner

belav commented Jan 31, 2024

I've found that comments tend to cause a lot of edge cases like this, and I don't know that there is a good generic fix for it beyond just addressing them as they come up.

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

2 participants