@@ -3,11 +3,36 @@ Change Log
3
3
4
4
## Unreleased
5
5
6
- * Fix: Enum classes that only have an init block now also generate the required semicolon (#1952 )
7
- * Fix: Preserve typealiases in ` KSAnnotation.toAnnotationSpec() ` . (#1945 )
8
- * Fix: Preserve nullability in ` KSType.toClassName() ` . (#1956 )
9
- * New: Add ` KSTypeAlias.toClassName() ` . (#1956 )
10
- * New: Add ` KSType.toClassNameOrNull() ` . (#1956 )
6
+ ## Version 2.0.0
7
+
8
+ Thanks to [ @brokenhappy ] [ brokenhappy ] , [ @tajobe ] [ tajobe ] , [ @niyajali ] [ niyajali ] ,
9
+ [ @ForteScarlet ] [ ForteScarlet ] for contributing to this release.
10
+
11
+ _ 2024-10-23_
12
+
13
+ This release is source- and binary-compatible with KotlinPoet 1.x.
14
+
15
+ The most important behavior change in this release is that spaces in generated code don't wrap by
16
+ default anymore.
17
+
18
+ KotlinPoet 1.x used to replace space characters with newline characters whenever a given line of
19
+ code exceeded the length limit. This usually led to better code formatting, but could also lead to
20
+ compilation errors in generated code. Non-breaking spaces could be marked by the ` · ` character, but
21
+ the discoverability of this feature wasn't great.
22
+
23
+ KotlinPoet 2.0 does not wrap spaces, even if the line of code they occur in exceeds the length
24
+ limit. The newly introduced ` ♢ ` character can be used to mark spaces that are safe to wrap, which
25
+ can improve code formatting. The ` · ` character has been preserved for compatibility, but its
26
+ behavior is now equivalent to a regular space character.
27
+
28
+ * New: Kotlin 2.0.10.
29
+ * New: Spaces don't break by default.
30
+ * New: New ` ♢ ` placeholder representing a space that is safe to wrap.
31
+ * New: Add ` KSTypeAlias.toClassName() ` . (#1956 )
32
+ * New: Add ` KSType.toClassNameOrNull() ` . (#1956 )
33
+ * Fix: Enum classes that only have an init block now also generate the required semicolon. (#1953 )
34
+ * Fix: Preserve typealiases in ` KSAnnotation.toAnnotationSpec() ` . (#1956 )
35
+ * Fix: Preserve nullability in ` KSType.toClassName() ` . (#1956 )
11
36
12
37
## Version 1.18.1
13
38
@@ -863,3 +888,7 @@ _2017-05-16_
863
888
[sebek64]: https: // github.com/sebek64
864
889
[DanielGronau ]: https: // github.com/DanielGronau
865
890
[mitasov- ra]: https: // github.com/mitasov-ra
891
+ [brokenhappy]: https: // github.com/brokenhappy
892
+ [tajobe]: https: // github.com/tajobe
893
+ [niyajali]: https: // github.com/niyajali
894
+ [ForteScarlet ]: https: // github.com/ForteScarlet
0 commit comments