Skip to content

fix: comment break indentation of simple lambdas - #1713

Merged
belav merged 4 commits into
belav:mainfrom
TimothyMakkison:simple_lambda_comment
Mar 15, 2026
Merged

belav merged 4 commits into
belav:mainfrom
TimothyMakkison:simple_lambda_comment

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Oct 19, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #1147, again this is my first time fixing bugs, no idea if I'm doing it right

Lambdas seem pretty all over the place, I'm pretty sure () => has some issues as well

@belav

belav commented Oct 21, 2025

Copy link
Copy Markdown
Owner

This has possibly a single edge case that it still needs to handle - https://github.com/belav/csharpier-repos/pull/152/files

I think those all are this same issue

// input and expected output
        Assert.Collection(
            outputSteps,
            // First source output for diagnostics is unchanged.
            step => Assert.Equal(IncrementalStepRunReason.Unchanged, step.Reason),
            // Second source output for generated code is changed.
            step => Assert.Equal(IncrementalStepRunReason.Modified, step.Reason)
        );

// current changes cause it to do this
        Assert.Collection(
            outputSteps,
            // First source output for diagnostics is unchanged.
            step =>
                Assert.Equal(IncrementalStepRunReason.Unchanged, step.Reason),
            // Second source output for generated code is changed.
            step =>
                Assert.Equal(IncrementalStepRunReason.Modified, step.Reason)
        );

@TimothyMakkison

TimothyMakkison commented Oct 26, 2025 •

Copy link
Copy Markdown
Contributor Author

Okay, I think I've fixed this issue but have replaced it with a new one, see MemberChains.test. I don't think this is a new issue #1613 parenthesized lambda expressions have the same behaviour.

I assume the fix is found in ArgumentListLike.Print but it may be beyond my current understanding, I'd appreciate your help here.

Before

Select______________________________________(superLongName_________________________ =>
    true
);

After

Select______________________________________(superLongName_________________________ => true
); // weird parentheses,

@belav
belav merged commit c70b664 into belav:main Mar 15, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

Incorrect formatting for simple lambda expression with comment

2 participants