pprint

package pprint

Contains a convenient default pre-configured PPrinter.

Hard-coded and inflexible, but feel free to instantiate your own PPrint if you want to customize it.

Attributes

Members list

Type members

Classlikes

case class PPrinter(defaultWidth: Int, defaultHeight: Int, defaultIndent: Int, defaultEscapeUnicode: Boolean, defaultShowFieldNames: Boolean, colorLiteral: Attrs, colorApplyPrefix: Attrs, additionalHandlers: PartialFunction[Any, Tree]) extends Walker

Value parameters

additionalHandlers

Provide this to override how certain types are pretty-printed at runtime

colorApplyPrefix

What color to assign to Foo in Foo(bar, baz)

colorLiteral

What color to assign to literals like "lol" or 31337

defaultHeight

How tall to allow the pretty-printed output to become before truncated it with a ...

defaultIndent

How many spaces to indent each nested Tree.Apply by

defaultWidth

How wide to allow a pretty-printed value to become before wrapping

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Walker
class Object
trait Matchable
class Any
Show all
Known subtypes
object Color.type
Self type
object PPrinter

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
PPrinter.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Renderer

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Renderer.type
class Renderer(maxWidth: Int, colorApplyPrefix: Attrs, colorLiteral: Attrs, indentStep: Int)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
class Result(val iter: Iterator[Str], completedLineCount0: => Int, lastLineLength0: => Int)

The intermediate return type of the pretty-print system: provides an iterator which produces the actual string output, as well as metadata around that output that is only available after the iterator is exhausted

The intermediate return type of the pretty-print system: provides an iterator which produces the actual string output, as well as metadata around that output that is only available after the iterator is exhausted

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Result

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Result.type
object StringPrefix

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait TPrint[T]

Summoning an implicit TPrint[T] provides a pretty-printed string representation of the type T, much better than is provided by the default Type#toString. In particular

Summoning an implicit TPrint[T] provides a pretty-printed string representation of the type T, much better than is provided by the default Type#toString. In particular

  • More forms are properly supported and printed
  • Prefixed Types are printed un-qualified, according to what's currently in scope

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object TPrint extends TPrintLowPri

Attributes

Companion
trait
Supertypes
trait TPrintLowPri
class Object
trait Matchable
class Any
Self type
TPrint.type
case class TPrintColors(typeColor: Attrs)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
object BlackWhite.type
object Colors.type
object TPrintColors

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait TPrintLowPri

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TPrint.type
object TPrintLowPri

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait Tree

A lazy AST representing pretty-printable text. Models foo(a, b) foo op bar, and terminals foo in both lazy and eager forms

A lazy AST representing pretty-printable text. Models foo(a, b) foo op bar, and terminals foo in both lazy and eager forms

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Apply
class Infix
class KeyValue
class Lazy
class Literal
object Tree

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Tree.type
class Truncated(chunks0: Iterator[Str], width: Int, height: Int, truncationMarker: String) extends Iterator[Str]

Wraps an input iterator of colored fansi.Strs, and produces the same fansi.Strs but truncated once the wrapped-at-width text reaches beyond a certain height

Wraps an input iterator of colored fansi.Strs, and produces the same fansi.Strs but truncated once the wrapped-at-width text reaches beyond a certain height

Attributes

Supertypes
trait Iterator[Str]
trait IterableOnceOps[Str, Iterator, Iterator[Str]]
trait IterableOnce[Str]
class Object
trait Matchable
class Any
Show all
object Util

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Util.type
abstract class Walker

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class PPrinter
object Color.type

Inherited classlikes

object err

Attributes

Inherited from:
PPrinter
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def tprint[T : TPrint](implicit evidence$1: TPrint[T], config: TPrintColors): Str

Inherited methods

def apply(x: Any, width: Int, height: Int, indent: Int, initialOffset: Int, escapeUnicode: Boolean, showFieldNames: Boolean): Str

Converts an Any into a large colored fansi.Str

Converts an Any into a large colored fansi.Str

Attributes

Inherited from:
PPrinter
def log[T](x: Text[T], tag: String, width: Int, height: Int, indent: Int, escapeUnicode: Boolean, showFieldNames: Boolean)(implicit line: Line, fileName: FileName): T

Logs a given value to stdout with some metadata to identify where the log message came from. Hard-coded and not very flexible, but you can easily implement your own log method if you want to customize it further.

Logs a given value to stdout with some metadata to identify where the log message came from. Hard-coded and not very flexible, but you can easily implement your own log method if you want to customize it further.

Attributes

Inherited from:
PPrinter
def pprintln[T](x: T, width: Int, height: Int, indent: Int, initialOffset: Int, escapeUnicode: Boolean, showFieldNames: Boolean): Unit

Converts an Any into a large colored fansi.Str

Converts an Any into a large colored fansi.Str

Attributes

Inherited from:
PPrinter
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def tokenize(x: Any, width: Int, height: Int, indent: Int, initialOffset: Int, escapeUnicode: Boolean, showFieldNames: Boolean): Iterator[Str]

Converts an Any into an iterator of colored chunks, wrapped at a certain width and truncated at a certain height

Converts an Any into an iterator of colored chunks, wrapped at a certain width and truncated at a certain height

Attributes

Inherited from:
PPrinter
def treeify(x: Any, escapeUnicode: Boolean, showFieldNames: Boolean): Tree

Attributes

Inherited from:
Walker

Inherited fields

val tuplePrefix: String

Attributes

Inherited from:
Walker