Dotty Documentation

0.5.0-bin-SNAPSHOT

object Interactive
extends Object

High-level API to get information out of typed trees, designed to be used by IDEs.

[-] Constructors

[-] Members

[+] private object completionsFilter

Filter for names that should appear when looking for completions.

[+] def completions ( trees: List [ SourceTree ] , pos: SourcePosition ) ( implicit ctx: Context ) : ( Int, List [ Symbol ] )

Get possible completions from tree at pos

[+] def completions ( prefix: Type , boundary: Symbol ) ( implicit ctx: Context ) : List [ Symbol ]

Possible completions of members of prefix which are accessible when called inside boundary

[+] def enclosingDefinitionInPath ( path: List [ Tree ] ) ( implicit ctx: Context ) : Tree

The first tree in the path that is a definition.

[+] def enclosingSourceSymbol ( trees: List [ SourceTree ] , pos: SourcePosition ) ( implicit ctx: Context ) : Symbol

The source symbol of the closest enclosing tree with a symbol containing position pos.

[+] def enclosingType ( trees: List [ SourceTree ] , pos: SourcePosition ) ( implicit ctx: Context ) : Type

The type of the closest enclosing tree with a type containing position pos.

[+] def isDefinition ( tree: Tree ) : Boolean

Does this tree define a symbol ?

[+] def matchSymbol ( tree: Tree , sym: Symbol , includeOverriden: Boolean ) ( implicit ctx: Context ) : Boolean

Check if tree matches sym. This is the case if sym is the symbol of tree or, if includeOverriden is true, if sym is overriden by tree.

[+] def namedTrees ( trees: List [ SourceTree ] , includeReferences: Boolean , includeOverriden: Boolean , sym: Symbol ) ( implicit ctx: Context ) : List [ SourceTree ]

Find named trees with a non-empty position whose symbol match sym in trees.

Note that nothing will be found for symbols not defined in source code, use sourceSymbol to get a symbol related to sym that is defined in source code.

[+] def namedTrees ( trees: List [ SourceTree ] , includeReferences: Boolean , nameSubstring: String ) ( implicit ctx: Context ) : List [ SourceTree ]

Find named trees with a non-empty position whose name contains nameSubstring in trees.

[+] def namedTrees ( trees: List [ SourceTree ] , includeReferences: Boolean , treePredicate: NameTree => Boolean ) ( implicit ctx: Context ) : List [ SourceTree ]

Find named trees with a non-empty position satisfying treePredicate in trees.

[+] def pathTo ( trees: List [ SourceTree ] , pos: SourcePosition ) ( implicit ctx: Context ) : List [ Tree ]

The reverse path to the node that closest encloses position pos, or Nil if no such path exists. If a non-empty path is returned it starts with the tree closest enclosing pos and ends with an element of trees.

[+] private def safely ( op: => List [ T ] ) : List [ T ]
[+] @tailrec def sourceSymbol ( sym: Symbol ) ( implicit ctx: Context ) : Symbol

A symbol related to sym that is defined in source code.