Associates case class vals with the parameters of generated apply and copy methods
Associates case class vals with the parameters of generated apply and copy methods
Associates class vals with constructor parameters
Associates class vals with constructor parameters
Represent an import selector as a tree, including both names as trees.
Represent an import selector as a tree, including both names as trees.
Import selectors are not trees, but we can provide an extractor that converts the ImportSelectors into our own ImportSelectorTrees.
Import selectors are not trees, but we can provide an extractor that converts the ImportSelectors into our own ImportSelectorTrees.
Represent a modifier as a tree, including its position.
Represent a modifier as a tree, including its position.
Represent a Name as a tree, including its position.
Represent a Name as a tree, including its position.
The PlainText "tree" provides a hook into the source code generation.
The PlainText "tree" provides a hook into the source code generation.
When a PlainText tree occurs during source code generation, its print
method is called with the current AbstractPrinter#PrintingContext. The
result is inserted into the generated source code.
For some use cases (blank line, raw and indented string) implementations
already exist in the PlainText
object.
Note that PlainText trees should never be allowed to escape the Scala refactoring library, so be careful when using compiler utilities to transform trees.
Representation of self type annotations: self: A with B => ^^^^^^^^^^^^^^
Representation of self type annotations: self: A with B => ^^^^^^^^^^^^^^
The call to the super constructor in a class: class A(i: Int) extends B(i) ^^^^
The call to the super constructor in a class: class A(i: Int) extends B(i) ^^^^
The basic trait that is extended by the concrete expanders.
The basic trait that is extended by the concrete expanders.
Associates term symbols with missing ranges to related symbols that have ranges.
Associates term symbols with missing ranges to related symbols that have ranges.
The reason that we need this is that in some cases, the PC generates multiple symbols for one and the same symbol in user source code, one of them with a proper range position, and others just with offset positions. One place where this happens is in desugared for comprehensions with filter clauses. See Assembler Ticket #1002650.
Use TraversalTracing for debugging and PlainTraversals for production
Use TraversalTracing for debugging and PlainTraversals for production
A traverser that also traverses a TypeTree's original type.
A traverser that also traverses a TypeTree's original type.
A traverser that creates fake trees for various type trees so they can be treated as if they were regular trees.
A traverser that creates fake trees for various type trees so they can be treated as if they were regular trees.
Add some methods to Tree that make it easier to compare Trees by position and to extract the position of a tree's name, which is tricky for Selects.
Add some methods to Tree that make it easier to compare Trees by position and to extract the position of a tree's name, which is tricky for Selects.
A SourceLayoutTree can be used to insert arbitrary text into the code, for example, blank lines.
A SourceLayoutTree can be used to insert arbitrary text into the code, for example, blank lines.
(Since version 0.5.0) Use PlainText objects and its components
Extracts information from ApplyNodes
Extracts information from ApplyNodes
The main feature of this extractor is that reverses the desugarings the compiler performs for named arguments by creating scala.tools.refactoring.common.EnrichedTrees.NamedArgument instances as necessary. Apart from that, this object is meant to mimic the regular scala.reflect.api.Trees.ApplyExtractor.
Unify the children of a Block tree and sort them in the same order they appear in the source code.
Unify the children of a Block tree and sort them in the same order they appear in the source code.
Also reshapes some trees: multiple assignments are removed and named argument trees are created.
Note that this extractor is needed primarily for tree printing. The rename refactoring for example, that doesn't use tree printing, would work with
object BlockExtractor { def unapply(t: Block) = { Some(t.expr :: t.stats) } }
as well.
Extract the modifiers with their position from a Modifiers object.
Extract the modifiers with their position from a Modifiers object.
Provides a finer-grained extractor for Template that distinguishes between class constructor parameters, early definitions, parents, self type annotation and the real body.
Provides a finer-grained extractor for Template that distinguishes between class constructor parameters, early definitions, parents, self type annotation and the real body.
Copy of scala.reflect.internal.Trees.ValOrDefDef of 2.11 to support 2.10.
Copy of scala.reflect.internal.Trees.ValOrDefDef of 2.11 to support 2.10.
Returns the (symbol) ancestors of the tree excluding the ROOT in descending order. Also filters the symbols for package objects!
Converts a tree containing Idents and Selects to a .
separated string.
Converts a tree containing Idents and Selects to a .
separated string.
Returns a fully loaded and typed Tree instance for the given SourceFile.
Returns a fully loaded and typed Tree instance for the given SourceFile.
Returns all children that have a representation in the source code.
Returns all children that have a representation in the source code. This includes Name and Modifier trees and excludes everything that has no Position or is an EmptyTree.
Trees that reach the end of the file don't seem to have the correct end position, except if there's a newline at the end.
Trees that reach the end of the file don't seem to have the correct end position, except if there's a newline at the end.
Takes a name and wraps it in if the name corresponds to a Scala keyword.
Takes a name and wraps it in if the name corresponds to a Scala keyword.
Finds a tree by its position, can be used to find the original tree from a transformed tree.
Finds a tree by its position, can be used to find the original tree from a transformed tree.
If multiple trees are candidates, then take the last one, because it is likely more specific.
Searches for a Symbol of a name in the type members of a tree.
Searches for a Symbol of a name in the type members of a tree.
This is mainly used for ImportSelectors, which don't carry any symbol information with them.
The expr of an Import tree.
The name of an ImportSelector of the import.
Returns whether the tree is considered empty.
Returns whether the tree is considered empty.
Prior to Scala 2.10.1 it was sufficient to check Tree#isEmpty, but now we also need to check if the tree is equal to emptyValDef.
Returns the most specific package declaration in the compilation
unit. For example, given the following declaration:
package a
package b
class C
it returns b
. If there are further nested packages, they are ignored:
package a
class C
package b
returns a
.
(Since version 0.5.0) Use PlainText objects and its components
Provides an implementation of the Indexes.IndexLookup trait by combining various CompilationUnitIndexes. Note that creating the GlobalIndex is cheap, all the compilation units were already indexed, and all further work is only done on demand.