|
| 1 | +# 1.0.3 |
| 2 | +## What's Changed |
| 3 | +### Switch block case with conditionals adding newlines [#1630](https://github.com/belav/csharpier/issues/1630) |
| 4 | +Switch blocks were breaking on conditions within patterns. |
| 5 | +```c# |
| 6 | +// input and expected output |
| 7 | +switch ("") |
| 8 | +{ |
| 9 | + case "" or "": |
| 10 | + break; |
| 11 | +} |
| 12 | + |
| 13 | +// 1.0.2 |
| 14 | +switch ("") |
| 15 | +{ |
| 16 | + case "" |
| 17 | + or "": |
| 18 | + break; |
| 19 | +} |
| 20 | +``` |
| 21 | +### switch expression formatting adds odd newlines [#1620](https://github.com/belav/csharpier/issues/1620) |
| 22 | +CSharpier was breaking after a discard with a when, resulting in extra new lines |
| 23 | +```c# |
| 24 | +// input and expected output |
| 25 | +_ = someValue switch |
| 26 | +{ |
| 27 | + _ when KeepWhenWithDiscard() => "", |
| 28 | + _ when KeepWhenWithDiscard_________________( |
| 29 | + SomeObject_______________________________________________ |
| 30 | + ) => "", |
| 31 | + _ when KeepWhenWithDiscard_________________( |
| 32 | + SomeObject_______________________________________________ |
| 33 | + ) => "LongString_____________________________________________________________________", |
| 34 | +}; |
| 35 | + |
| 36 | +// 1.0.2 |
| 37 | +_ = someValue switch |
| 38 | +{ |
| 39 | + _ when KeepWhenWithDiscard() => "", |
| 40 | + _ |
| 41 | + when KeepWhenWithDiscard_________________( |
| 42 | + SomeObject_______________________________________________ |
| 43 | + ) => "", |
| 44 | + _ |
| 45 | + when KeepWhenWithDiscard_________________( |
| 46 | + SomeObject_______________________________________________ |
| 47 | + ) => "LongString_____________________________________________________________________", |
| 48 | +}; |
| 49 | + |
| 50 | +``` |
| 51 | +### multi-line raw string in linq query causes a subsequent linq query to be printed on one line [#1617](https://github.com/belav/csharpier/issues/1617) |
| 52 | +If a query syntax linq expression contained a raw string, it could result in method invocations not breaking. |
| 53 | +```c# |
| 54 | +// input and expected output |
| 55 | +( |
| 56 | + from x in SomeMethod() |
| 57 | + select """ |
| 58 | + someString |
| 59 | + """ |
| 60 | +) |
| 61 | + .CallMethod_____________________________________________() |
| 62 | + .CallMethod_____________________________________________(); |
| 63 | + |
| 64 | +// 1.0.2 |
| 65 | +( |
| 66 | + from x in SomeMethod() |
| 67 | + select """ |
| 68 | + someString |
| 69 | + """ |
| 70 | +).CallMethod_____________________________________________().CallMethod_____________________________________________(); |
| 71 | + |
| 72 | +``` |
| 73 | + |
| 74 | +**Full Changelog**: https://github.com/belav/csharpier/compare/1.0.2...1.0.3 |
1 | 75 | # 1.0.2 |
2 | 76 | ## What's Changed |
3 | 77 | ### Performance issues when supporting .gitignore. [#1588](https://github.com/belav/csharpier/issues/1588) |
@@ -3266,5 +3340,6 @@ Thanks go to @pingzing |
3266 | 3340 |
|
3267 | 3341 |
|
3268 | 3342 |
|
| 3343 | +
|
3269 | 3344 |
|
3270 | 3345 |
|
0 commit comments