scala.tools.refactoring.implementations
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.
Represent a modifier 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.
PrintingContext is passed around with all the print methods and contains the context or environment for the current printing.
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) ^^^^
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.
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.
Unify the children of a Block tree and sort them in the same order they appear in the source code.
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.
When extracting source code from the file via a tree's position, it depends on the tree type whether we can use the position's start or point.
When extracting source code from the file via a tree's position, it depends on the tree type whether we can use the position's start or point.
The tree that will be replaced.
The position to adapt. This does not have to be the position of t.
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 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.
Creates a list of TextChanges from a list of trees, regenerating only those trees that have changed.
Creates a list of TextChanges from a list of trees, regenerating only those trees that have changed.
Creates a fragment from a tree, regenerating only those trees that have changed.
Creates a fragment from a tree, regenerating only those trees that have changed.
Creates a string from a tree, regenerating all trees.
Creates a string from a tree, regenerating all trees.
If the sourceFile parameter is passed, it will be used to figure out what kinds of newline separators we should generate. If None is passed, '\n' is used.
The characters that are used to indent changed code.
The characters that are used to indent changed code.
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.
Starting from a root tree, returns all children that have changed.
Starting from a root tree, returns all children that have changed. The format of the result is a tuple of a top-level tree, a position of the range that should be replaced and a set of all trees that changed in the context of that top-level tree, including the top-level tree.
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.
The characters that surround an import with multiple import selectors inside the braces:
The characters that surround an import with multiple import selectors inside the braces:
import a.{*name*}
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