Releases: polyvariant/better-tostring
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
Includes a new feature, prefixing a class with the name of the enclosing object - contributed by @mrobakowski in #27 🎉
Given this code:
object A {
case class B(s: String)
}
A.B("ss")
before the change we would be seeing B(s = ss)
, now it will be A.B(s = ss)
. Note that the name of the object is not prefixed if it's a package object, and classes nested in other classes are still not influenced by the plugin.
This works for Scala 3 enums as well:
enum Foo:
case Bar
case Baz(s: String)
// outputs Foo.Baz(s = hello)
@main def demo = println(Foo.Baz("hello"))
This behavior is not up to configuration, and will likely increase verbosity of your toString
calls - if you don't want that to be the case, it is suggested to implement toString
on your own.
v0.2.10
v0.2.9
v0.2.8
Notable changes:
- Scala 3 support
- test suite
This release features initial Scala 3 support (3.0.0-M3, 3.0.0-RC1)! Many thanks to @mrobakowski for implementing the first version, which let me save a lot of effort figuring out what's changed.
The core logic of the plugin is ~95% the same code cross-compiled between the two major versions of the compiler, using a common API for some simple operations provided by the raw compiler plugin API - this should allow us to keep all versions with the same behavior and no unexpected changes between versions.
We also got a test suite to ensure the plugin works as designed.