ImportHook

ammonite.runtime.ImportHook
See theImportHook companion object
trait ImportHook

An extensible hook into the Ammonite REPL's import system; allows the end user to hook into import $foo.bar.{baz, qux => qua} syntax, and in response load jars or process source files before the "current" compilation unit is run. Can be used to load script files, ivy dependencies, jars, or files from the web.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Classpath
class BaseIvy
object Ivy
object PluginIvy
object Repo
class SourceHook
object Exec
object File
object URL
Show all

Members list

Value members

Abstract methods

def handle(source: CodeSource, tree: ImportTree, interp: InterpreterInterface, wrapperPath: Seq[Name]): Either[String, Seq[Result]]

Handle a parsed import that this import hook was registered to be interested in

Handle a parsed import that this import hook was registered to be interested in

Note that source is optional; not every piece of code has a source. Most user code does, e.g. a repl session is based in their CWD, a script has a path, but some things like hardcoded builtin predefs don't

Attributes