Case Class toString new behavior proposal (with implementation)

PPrint 0.6.0 implemented support in Include field names in rendering of Product (Scala 2.13 only) #38, for example

case class Address(planet: String, city: String)
case class User(name: String, age: Int, address: Address)
pprint.pprintln(User("Picard", 75, Address("Earth", "San Francisco")), width = 80, height = 80)

outputs

User(
  name = "Picard",
  age = 75,
  address = Address(planet = "Earth", city = "San Francisco")
)
4 Likes