Skip to content

1.0.3

Choose a tag to compare

@belav belav released this 29 Jun 17:19
· 106 commits to main since this release

What's Changed

Switch block case with conditionals adding newlines #1630

Switch blocks were breaking on conditions within patterns.

// input and expected output
switch ("")
{
    case "" or "":
        break;
}

// 1.0.2
switch ("")
{
    case ""
    or "":
        break;
}

switch expression formatting adds odd newlines #1620

CSharpier was breaking after a discard with a when, resulting in extra new lines

// input and expected output
_ = someValue switch
{
    _ when KeepWhenWithDiscard() => "",
    _ when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "",
    _ when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "LongString_____________________________________________________________________",
};

// 1.0.2
_ = someValue switch
{
    _ when KeepWhenWithDiscard() => "",
    _
        when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "",
    _
        when KeepWhenWithDiscard_________________(
            SomeObject_______________________________________________
        ) => "LongString_____________________________________________________________________",
};

multi-line raw string in linq query causes a subsequent linq query to be printed on one line #1617

If a query syntax linq expression contained a raw string, it could result in method invocations not breaking.

// input and expected output
(
    from x in SomeMethod()
    select """
        someString
        """
)
    .CallMethod_____________________________________________()
    .CallMethod_____________________________________________();

// 1.0.2
(
    from x in SomeMethod()
    select """
        someString
        """
).CallMethod_____________________________________________().CallMethod_____________________________________________();

Full Changelog: 1.0.2...1.0.3