@@ -3,11 +3,36 @@ Change Log
33
44## Unreleased
55
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 )
1136
1237## Version 1.18.1
1338
@@ -863,3 +888,7 @@ _2017-05-16_
863888 [sebek64]: https: // github.com/sebek64
864889 [DanielGronau ]: https: // github.com/DanielGronau
865890 [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