Dotty Documentation

0.9.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

[+] object Include
[+] private object completionsFilter

Filter for names that should appear when looking for completions.

[+] def completions ( 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

[+] private def computeCompletions ( pos: SourcePosition , path: List [ Tree ] ) ( implicit ctx: Context ) : ( Int, List [ Symbol ] )
[+] def contextOfPath ( path: List [ Tree ] ) ( implicit ctx: Context ) : Context
[+] def contextOfStat ( stats: List [ Tree ] , stat: Tree , exprOwner: Symbol , ctx: Context ) : Context
[+] 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 enclosingTree ( trees: List [ SourceTree ] , pos: SourcePosition ) ( implicit ctx: Context ) : Tree

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 , include: Set ) ( implicit ctx: Context ) : Boolean

Check if tree matches sym. This is the case if the symbol defined by tree equals sym, or the source symbol of tree equals sym, or include is overridden, and tree is overridden by sym, or include is overriding, and tree overrides sym.

[+] def namedTrees ( trees: List [ SourceTree ] , include: Set , 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.

[+] def pathTo ( tree: Tree , pos: Position ) ( implicit ctx: Context ) : List [ Tree ]
[+] 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.