|
1 | | -# Latest v2.0.0 |
| 1 | +# Latest v2.1.0 |
| 2 | + |
| 3 | +## Enhancements |
| 4 | + |
| 5 | +- Support for require-pragma option (Issue [#573](https://github.com/jhipster/prettier-java/issues/573) closed with [#574](https://github.com/jhipster/prettier-java/pull/574)) |
| 6 | + Thanks to [@yannick-paz](https://github.com/yannick-paz) for the contribution ! |
| 7 | + |
| 8 | +```java |
| 9 | +// Input |
| 10 | +/** |
| 11 | + * @prettier |
| 12 | + */ |
| 13 | +public class Example { private int test=-1;} |
| 14 | + |
| 15 | +// Output with require-pragma option activated |
| 16 | +/** |
| 17 | + * @prettier |
| 18 | + */ |
| 19 | +public class Example { |
| 20 | + private int test = -1; |
| 21 | +} |
| 22 | + |
| 23 | +// Input |
| 24 | +public class Example { private int test=-1;} |
| 25 | + |
| 26 | +// Output with require-pragma option activated |
| 27 | +public class Example { private int test=-1;} |
| 28 | +``` |
| 29 | + |
| 30 | +## Fixes |
| 31 | + |
| 32 | +- Break long assignments after equals (Issue [#527](https://github.com/jhipster/prettier-java/issues/527) closed with [#564](https://github.com/jhipster/prettier-java/pull/564)) |
| 33 | + Thanks to [@jtkiesel](https://github.com/jtkiesel) for the fix ! |
| 34 | + |
| 35 | +```java |
| 36 | +// Input |
| 37 | +class Example { |
| 38 | + |
| 39 | + void example() { |
| 40 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes = new Object() |
| 41 | + .someMethod(); |
| 42 | + |
| 43 | + Object[] aParticularlyLongAndObnoxiousNameForIllustrativePurposes2 = new Object[] { |
| 44 | + new Object(), |
| 45 | + new Object() |
| 46 | + }; |
| 47 | + |
| 48 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes3 = SomeClass.someStaticMethod(); |
| 49 | + |
| 50 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes = someMethod() |
| 51 | + .anotherMethod(); |
| 52 | + |
| 53 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes = anotherValue != |
| 54 | + null |
| 55 | + ? anotherValue |
| 56 | + : new Object(); |
| 57 | + } |
| 58 | +} |
| 59 | + |
| 60 | +// Output |
| 61 | +class Example { |
| 62 | + |
| 63 | + void example() { |
| 64 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes = |
| 65 | + new Object().someMethod(); |
| 66 | + |
| 67 | + Object[] aParticularlyLongAndObnoxiousNameForIllustrativePurposes2 = |
| 68 | + new Object[] { new Object(), new Object() }; |
| 69 | + |
| 70 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes3 = |
| 71 | + SomeClass.someStaticMethod(); |
| 72 | + |
| 73 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes = |
| 74 | + someMethod().anotherMethod(); |
| 75 | + |
| 76 | + Object aParticularlyLongAndObnoxiousNameForIllustrativePurposes = |
| 77 | + anotherValue != null ? anotherValue : new Object(); |
| 78 | + } |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +# v2.0.0 |
2 | 83 |
|
3 | 84 | ## Breaking changes |
4 | 85 | - Drop support of Node.js 12 |
|
0 commit comments