ammonite.util

Members list

Concise view

Type members

Classlikes

case class Bind[T](name: String, value: T)(implicit typeName: TypeName[T])

Models a binding of a value to a typed name, and is passed into the REPL so it can re-create the bindings inside the REPL's scope

Models a binding of a value to a typed name, and is passed into the REPL so it can re-create the bindings inside the REPL's scope

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Bind

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Bind.type
case class Catching(handler: PartialFunction[Throwable, Failing])

Fake for-comprehension generator to catch errors and turn them into Res.Failures

Fake for-comprehension generator to catch errors and turn them into Res.Failures

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Classpath

Loads the jars that make up the classpath of the scala-js-fiddle compiler and re-shapes it into the correct structure to satisfy scala-compile and scalajs-tools

Loads the jars that make up the classpath of the scala-js-fiddle compiler and re-shapes it into the correct structure to satisfy scala-compile and scalajs-tools

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
case class Colors(prompt: Ref[Attrs], ident: Ref[Attrs], `type`: Ref[Attrs], literal: Ref[Attrs], prefix: Ref[Attrs], comment: Ref[Attrs], keyword: Ref[Attrs], selected: Ref[Attrs], error: Ref[Attrs], warning: Ref[Attrs], info: Ref[Attrs])

A set of colors used to highlight the miscellaneous bits of the REPL. Re-used all over the place in PPrint, TPrint, syntax highlighting, command-echoes, etc. in order to keep things consistent

A set of colors used to highlight the miscellaneous bits of the REPL. Re-used all over the place in PPrint, TPrint, syntax highlighting, command-echoes, etc. in order to keep things consistent

Attributes

`type`

Definition of types

error

The color used to print error messages of all kinds

ident

Definition of top-level identifiers

literal

Strings, integers and other literal expressions

prefix

The Seq/Foo when printing a Seq(...) or case class Foo(...)

prompt

The command prompt

selected

The color of text selected in the line-editor

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Colors

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Colors.type
class CompilationError(message: String) extends Exception

Exception for reporting script compilation failures

Exception for reporting script compilation failures

Attributes

Graph
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
case class Evaluated(wrapper: Seq[Name], imports: Imports)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Ex

Nice pattern matching for chained exceptions

Nice pattern matching for chained exceptions

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Ex.type
trait Frame

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Frame

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Frame.type
case class ImportData(fromName: Name, toName: Name, prefix: Seq[Name], importType: ImportType)

Represents the importing of a single name in the Ammonite REPL, of the form

Represents the importing of a single name in the Ammonite REPL, of the form

import $prefix.{$fromName => $toName}

All imports are reduced to this form; import $prefix.$name is results in the fromName and toName being the same, while import $prefix._ or import $prefix.{foo, bar, baz} are split into multiple distinct ImportData objects.

Note that imports can be of one of three distinct ImportTypes: importing a type, a term, or both. This lets us properly deal with shadowing correctly if we import the type and term of the same name from different places

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object ImportData

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ImportHookInfo(imports: Imports, stmts: Seq[String], trees: Seq[ImportTree])

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class ImportTree(prefix: Seq[String], mappings: Option[ImportMapping], start: Int, end: Int)

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object ImportTree

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
class Imports

Represents the imports that occur before a piece of user code in the Ammonite REPL. It's basically a Seq[ImportData], except we really want it to be always in a "canonical" form without shadowed/duplicate imports.

Represents the imports that occur before a piece of user code in the Ammonite REPL. It's basically a Seq[ImportData], except we really want it to be always in a "canonical" form without shadowed/duplicate imports.

Thus we only expose an apply method which performs this de-duplication, and a ++ operator that combines two sets of imports while performing de-duplication.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object Imports

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Imports.type
case class Name(raw: String)

Represents a single identifier in Scala source code, e.g. "scala" or "println" or "Hello-World".

Represents a single identifier in Scala source code, e.g. "scala" or "println" or "Hello-World".

Holds the value "raw", with all special characters intact, e.g. "Hello-World". Can be used backticked e.g. "Hello-World", useful for embedding in Scala source code, or encoded e.g. "Hello$minusWorld", useful for accessing names as-seen-from the Java/JVM side of things

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Name

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Name.type
final case class Position(line: Int, char: Int)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class PredefInfo(name: Name, code: String, hardcoded: Boolean, path: Option[Path])

Information about a particular predef file or snippet. hardcoded represents whether or not we cache the snippet forever regardless of classpath, which is true for many "internal" predefs which only do imports from Ammonite's own packages and don't rely on external code

Information about a particular predef file or snippet. hardcoded represents whether or not we cache the snippet forever regardless of classpath, which is true for many "internal" predefs which only do imports from Ammonite's own packages and don't rely on external code

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class Printer(outStream: PrintStream, errStream: PrintStream, resultStream: PrintStream, warning: String => Unit, error: String => Unit, info: String => Unit)

Encapsulates the ways the Ammonite REPL prints things. Does not print a trailing newline by default; you have to add one yourself.

Encapsulates the ways the Ammonite REPL prints things. Does not print a trailing newline by default; you have to add one yourself.

Attributes

errStream

Direct access to print to stderr

error

How you want it to print a compile error

info

How you want to print compile info logging. Not the same as out, which is used to print runtime output.

outStream

Direct access to print to stdout

resultStream

Direct access to print the result of the entered code

warning

How you want it to print a compile warning

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
trait Ref[T] extends StableRef[T]

Attributes

Companion:
object
Graph
Supertypes
trait StableRef[T]
class Object
trait Matchable
class Any
object Ref

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Ref.type
abstract class ReplClassLoader(urls: Array[URL], parent: ClassLoader) extends URLClassLoader

Attributes

Graph
Supertypes
class URLClassLoader
trait Closeable
trait AutoCloseable
class SecureClassLoader
class ClassLoader
class Object
trait Matchable
class Any
sealed abstract class Res[+T]

The result of a single pass through the ammonite REPL. Results in a single T, or of one of a fixed number of failures that are common for anyone who is evaluating code via the REPL.

The result of a single pass through the ammonite REPL. Results in a single T, or of one of a fixed number of failures that are common for anyone who is evaluating code via the REPL.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Failing
class Exception
class Exit
class Failure
object Skip.type
class Success[T]
object Res

Attributes

Companion:
class
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Res.type
case class ScriptOutput(processed: Metadata, classFiles: Seq[ClassFiles])

The serialized output of running a script, including both metadata and the classfile binaries

The serialized output of running a script, including both metadata and the classfile binaries

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait StableRef[T]

Encapsulates a read-write cell that can be passed around

Encapsulates a read-write cell that can be passed around

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Ref[T]
case class Tag(code: String, env: String, classPathWhitelistHash: String)

A unique key for a piece of code that gets run in a particular environment; contains the hash of the code and the hash of the environment stored separately, so you can e.g. compare the env hash even if you don't have the code available

A unique key for a piece of code that gets run in a particular environment; contains the hash of the code and the hash of the environment stored separately, so you can e.g. compare the env hash even if you don't have the code available

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Util

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Util.type
class WhiteListClassLoader(whitelist: Set[Seq[String]], parent: ClassLoader) extends URLClassLoader

Attributes

Graph
Supertypes
class URLClassLoader
trait Closeable
trait AutoCloseable
class SecureClassLoader
class ClassLoader
class Object
trait Matchable
class Any