ammonite.shell

PathComplete

object PathComplete

Logic to find path "literals" so we can attempt to autocomplete them based on what's actually on the filesystem.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PathComplete
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait Interval extends AnyRef

    Enum used to tag the indices being returned by Highlighter

  2. case class PathLiteralInfo(base: Option[String], body: Seq[Option[String]], frag: Option[String], offset: Int) extends Product with Serializable

  3. sealed trait Span extends AnyRef

    More-convenient data-structures to work with, compared to the raw tuple-output of Highlighter

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Interval

  7. object Span

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def colorPath(path: Path): EscapeAttr

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def findPathLiteral(snippet: String, cursor: Int): Option[PathLiteralInfo]

    Searches the current snippet for path-like forms ending at the current cursor.

    Searches the current snippet for path-like forms ending at the current cursor. Doesn't actually go to the filesystem to see what exists, just returns a PathLiteralInfo representing the structure of the path-like-syntax it found

    The overall approach is somewhat convoluted, but roughly:

    - Use highlightIndices to search for all syntactic instances of strings, identifiers or symbols within the text, since those are the forms that can comprise path literals - Convert the raw index-tuples into a sequence of objects representing each found form - Search backwards from the end of the that list. Take up any initial (possibly half-complete) Symbol/String literal to become the frag, gobble up any /s followed by ups or Symbol/String literals to form the path, and stop if you reach a absolute path "literal" wd/pwd/home/root or if you can't parse anything anymore.

    snippet

    The entire code snippet in which we are requesting autocomplete

    cursor

    The position of the cursor when the user hits Tab

    returns

    None if no autocomplete is possible, otherwise a PathLiteralInfo

  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def pathCompleteFilter(wd: ⇒ Path, colors: ⇒ Colors): Filter

  22. val rootMap: Map[Option[String], (Path) ⇒ Path]

    Small hard-coded list of how to convert the names of various path-literal-roots into actual Paths.

    Small hard-coded list of how to convert the names of various path-literal-roots into actual Paths. Some depend on the REPL's wd, others don't

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped