Interactive
High-level API to get information out of typed trees, designed to be used by IDEs.
Attributes
- See also
-
InteractiveDriver
to get typed trees from code. - Graph
-
- Supertypes
- Self type
-
Interactive.type
Members list
Value members
Concrete methods
The first tree in the path that is a definition.
The first tree in the path that is a definition.
Attributes
The source symbols that are the closest to path
.
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.
Value parameters
- path
-
The path to the tree whose symbols to extract.
Attributes
- Returns
-
The source symbols that are the closest to
path
. - See also
-
sourceSymbol
The closest enclosing tree with a symbol containing position pos
, or the EmptyTree
.
The closest enclosing tree with a symbol containing position pos
, or the EmptyTree
.
Attributes
The closest enclosing tree with a symbol, or the EmptyTree
.
The closest enclosing tree with a symbol, or the EmptyTree
.
Attributes
The type of the closest enclosing tree with a type containing position pos
.
The type of the closest enclosing tree with a type containing position pos
.
Attributes
Find the definitions of the symbol at the end of path
. In the case of an import node, all imported symbols will be considered.
Find the definitions of the symbol at the end of path
. In the case of an import node, all imported symbols will be considered.
Value parameters
- driver
-
The driver responsible for
path
. - path
-
The path to the symbol for which we want the definitions.
Attributes
- Returns
-
The definitions for the symbol at the end of
path
.
Find the definitions of symbols
.
Find the definitions of symbols
.
Value parameters
- driver
-
The driver responsible for the given symbols.
- includeExternal
-
If true, also look for definitions on the classpath.
- includeOverridden
-
If true, also include the symbols overridden by any of
symbols
. - symbols
-
The list of symbols for which to find a definition.
Attributes
- Returns
-
The definitions for the symbols in
symbols
, and ifincludeOverridden
is set, the definitions for the symbols that they override.
Find trees that match symbol
in trees
.
Find trees that match symbol
in trees
.
Value parameters
- includes
-
Whether to include references, definitions, etc.
- predicate
-
An additional predicate that the trees must match.
- symbol
-
The symbol for which we want to find references.
- trees
-
The trees to inspect.
Attributes
Return a predicate function that determines whether a given NameTree
is an implementation of sym
.
Return a predicate function that determines whether a given NameTree
is an implementation of sym
.
Value parameters
- sym
-
The symbol whose implementations to find.
Attributes
- Returns
-
A function that determines whether a
NameTree
is an implementation ofsym
.
Does this tree define a symbol ?
Does this tree define a symbol ?
Attributes
Is this tree using a renaming introduced by an import statement or an alias for this
?
Is this tree using a renaming introduced by an import statement or an alias for this
?
Value parameters
- tree
-
The tree to inspect
Attributes
- Returns
-
True, if this tree's name is different than its symbol's name, indicating that it uses a renaming introduced by an import statement or an alias for
this
.
Given sym
, originating from sourceDriver
, find its representation in targetDriver
.
Given sym
, originating from sourceDriver
, find its representation in targetDriver
.
Value parameters
- sourceDriver
-
The driver from which
symbol
originates. - symbol
-
The symbol to expression in the new driver.
- targetDriver
-
The driver in which we want to get a representation of
symbol
.
Attributes
- Returns
-
A representation of
symbol
intargetDriver
.
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
.
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
.
Attributes
Find named trees with a non-empty position whose symbol match sym
in trees
.
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.
Attributes
Find named trees with a non-empty position satisfying treePredicate
in trees
.
Find named trees with a non-empty position satisfying treePredicate
in trees
.
Value parameters
- include
-
Whether to include references, definitions, etc.
- treePredicate
-
An additional predicate that the trees must match.
- trees
-
The trees to inspect.
Attributes
- Returns
-
The trees with a non-empty position satisfying
treePredicate
.
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
.
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
.
Note that if the given pos
points out places for incomplete parses, this method returns errorTermTree
(Literal(Consotant(null)
).
Attributes
- See also