Dotty Documentation

0.11.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 enclosingSourceSymbols ( path: List [ Tree ] , pos: SourcePosition ) ( implicit ctx: Context ) : List [ Symbol ]

The source symbols that are the closest to path.

If this path ends in an import, then this returns all the symbols that are imported by this import statement.

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

The closest enclosing tree with a symbol containing position pos, or the EmptyTree.

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

The closes enclosing tree with a symbol, or the EmptyTree.

[+] 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 findDefinitions ( path: List [ Tree ] , pos: SourcePosition , driver: InteractiveDriver ) ( implicit ctx: Context ) : List [ SourceTree ]

Find the definitions of the symbol at the end of path.

[+] def findTreesMatching ( trees: List [ SourceTree ] , includes: Set , symbol: Symbol , predicate: NameTree => Boolean ) ( implicit ctx: Context ) : List [ SourceTree ]

Find trees that match symbol in trees.

[+] def findTreesMatching$default$4 : Any => Boolean

Find trees that match symbol in trees.

[+] def implementationFilter ( sym: Symbol ) ( implicit ctx: Context ) : NameTree => Boolean

Return a predicate function that determines whether a given NameTree is an implementation of sym.

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

Does this tree define a symbol ?

[+] def isRenamed ( tree: NameTree ) ( implicit ctx: Context ) : Boolean

Is this tree using a renaming introduced by an import statement or an alias for this?

[+] def localize ( symbol: Symbol , sourceDriver: InteractiveDriver , targetDriver: InteractiveDriver ) : Symbol

Given sym, originating from sourceDriver, find its representation in targetDriver.

[+] 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 ] , 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 ] , include: Set , 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 ]
[+] def sameName ( n0: Name , n1: Name ) : Boolean

Are the two names the same?