PPrint
PPrint copied to clipboard
Pretty-printing value, types and type-signatures in Scala
We are using pprint in property based testing, where we create arbitrary strings. Sadly, pprint fails on some of those characters: `Message: Unknown ansi-escape at index 3 inside string cannot...
This PR makes the calls to `Iterable.collectionClassName` more "standard", that is not reflection-based. Reflection is an issue on GraalVM native-image, where all collection concrete classes would need to be added...
I'm seeing a `MatchError` thrown during compilation when `TPrintImpl` encounters a `PolyType`. The full error is: ``` exception during macro expansion: scala.MatchError: [+A]Playground.Foo[A] (of class scala.reflect.internal.Types$PolyType) at pprint.TPrintLowPri$.typePrintImplRec0(TPrintImpl.scala:151) at pprint.TPrintLowPri$.typePrintImplRec(TPrintImpl.scala:32)...
Right here: https://github.com/com-lihaoyi/PPrint/blob/3abeed80a4282f2c08768528eff7e24c07d05603/pprint/src/pprint/Renderer.scala#L147 `fansi.Str(_)` allows one to pass in an ErrorMode controlling whether an exception is thrown. But this call here defaults to throwing an exception. One can also sanitize...
The link to https://www.lihaoyi.com/PPrint/ returns a 404
Here is a simple example. ``` val nodeStr = s""" |[A] |[B] |""".stripMargin.trim case class Prod(prefix: String)(vs: Any*) extends Product { override def productPrefix: String = prefix override def productArity:...
``` Welcome to the Ammonite Repl 1.6.9 (Scala 2.12.8 Java 1.8.0_202-ea) If you like Ammonite, please support our development at www.patreon.com/lihaoyi @ val x = x: xml.ProcInstr = ProcInstr( ProcInstr(...
I think it would be extremely helpful if we'd have a way to do blacklining on case classes, or collections to see which of the parameters are different. For example...
The documentation at www.lihaoyi.com/PPrint/ currently describes the return type of many methods as `String`, when it is actually `fansi.Str`. Linking to the [fansi](https://github.com/lihaoyi/fansi) library in the documentation would be greatly...