You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Lambda body's first comparison split when arguments stay on the call line before a trailing lambda #1941
Since 1.4.0 (#1865), the arguments before a trailing lambda stay on the call's line. For the input below, though, the line doesn't break after =>. The lambda body's first operand, type, stays on the call's line, and the rest of its == comparison wraps to the next line. The breaks after if ( and before the closing ) are also dropped, so the call ends in )) on the last line of the lambda.
Other calls with simpler lambdas in the same file format as #1865 describes.
Steps to Reproduce
CSharpier 1.4.0, with .editorconfig setting indent_style = tab and max_line_length = 120.
Input (1.3.0 leaves it unchanged):
publicclassC{publicasyncTaskM(){if(true){if(!awaitDatabase.ReplaceWithRetryAsync<Account>(credentials.AccountID,
current =>type==PaymentMethodType.CreditCard&¤t.PaymentMethod.Card?.Registeredisnull?thrownewDatabaseException(HttpStatusCode.BadRequest,"No registered card."){RejectionReason=ServiceRejectionReason.CardNotRegistered,}:current.PaymentMethod.Type==type?null:currentwith{PaymentMethod=current.PaymentMethodwith{Type=type}})){return;}}}}
Expected Behavior
The line breaks after =>, as #1865 describes. Otherwise CSharpier falls back to the 1.3.0 layout, with each argument on its own line and the breaks after if ( and before the closing ) kept.
Actual Behavior
publicclassC{publicasyncTaskM(){if(true){if(!awaitDatabase.ReplaceWithRetryAsync<Account>(credentials.AccountID, current =>type==PaymentMethodType.CreditCard&¤t.PaymentMethod.Card?.Registeredisnull?thrownewDatabaseException(HttpStatusCode.BadRequest,"No registered card."){RejectionReason=ServiceRejectionReason.CardNotRegistered,}:current.PaymentMethod.Type==type?null:currentwith{PaymentMethod=current.PaymentMethodwith{Type=type}})){return;}}}}
Activity
Fixing some issues with lambas (belav#1943)
Bump csharpier from 1.4.0 to 1.4.1 (#519)
Bump the nuget-deps group with 2 updates (#610)
Bump the nuget-deps group with 3 updates (#611)
Bump the docs-tests-all group with 1 update (#828)
Bump the all-dependencies group with 1 update (#1340)
Bump csharpier from 1.3.0 to 1.4.1 (#148)
Bump csharpier from 1.4.0 to 1.4.1 (#273)