Skip to content

Inconsistent formatting of single-line lambda expressions #1594

@OleRoss

Description

@OleRoss

CSharpier 1.0.1 with a line width configured to 120

Somehow, csharpier only breaks correctly if the number of characters in the line is 123 or above. 121 or 122 seems to cause the issue.
If there are multiple lambda expressions in the method call, the line breaks as expected.

Maybe this was caused by fixing #1522.

Apart from that, thanks for all the great work, I really enjoy using csharpier :)

Input:

RegisterSomething(() => DoSomething_________________________________________________________________________________());
RegisterSomething(() => DoSomething_________________________________________________________________________________1());
RegisterSomething(() => DoSomething_________________________________________________________________________________11());
RegisterSomething(() => DoSomething_________________________________________________________________________________111());

Output:

RegisterSomething(() => DoSomething_________________________________________________________________________________());
RegisterSomething(() => DoSomething_________________________________________________________________________________1()
);
RegisterSomething(() => DoSomething_________________________________________________________________________________11()
);
RegisterSomething(() =>
    DoSomething_________________________________________________________________________________111()
);

Expected behavior:

RegisterSomething(() => DoSomething_________________________________________________________________________________());
RegisterSomething(() =>
    DoSomething_________________________________________________________________________________1()
);
RegisterSomething(() =>
    DoSomething_________________________________________________________________________________11()
);
RegisterSomething(() =>
    DoSomething_________________________________________________________________________________111()
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions