csharpier
csharpier copied to clipboard
ParenthesizedExpression breaking inconsistently
Having a single invocation on a ParenthesizedExpression that is too long causes it to break like below. It would look better if it stayed consistent with the second example.
(
someObject as SomeLongType__________________________________________
).CallMethod();
(someObject as SomeLongType__________________________________________)
.CallMethod()
.CallMethod();
A potential solution is "never break ParenthesizedExpression unless its contents break"
Sounds like a good rule. It's inconsistent and adds an additional line of code for just a single bracket!
The first example would look better as
(someObject as SomeLongType__________________________________________)
.CallMethod();
Applying the same logic (don't break unless its contents break) to if (..), while (..), catch (..), (..) => would fix #924