scala.tools.refactoring.common.Selections
Returns true if the given Tree is fully contained in the selection.
Returns true if the given Tree is fully contained in the selection.
Returns the tree that encloses the whole selection.
Returns the tree that encloses the whole selection.
Expands the selection in such a way, that partially selected trees are completely selected.
Expands the selection in such a way, that partially selected trees are completely selected.
Expands to a specific type of tree.
Expands to a specific type of tree.
Tries to expand the selection to tree
if the current
selection contains only subtrees of tree
.
Tries to expand the selection to tree
if the current
selection contains only subtrees of tree
.
Tries to expand the selection to newPos
.
Tries to expand the selection to newPos
.
Expands the selection until pred
evaluates to true.
Expands the selection until pred
evaluates to true.
Tries to expand the selection to a tree that fully contains the selection but is not equal to the selection.
Tries to expand the selection to a tree that fully contains the selection but is not equal to the selection.
Finds a selected tree by its type.
Finds a selected tree by its type.
findSelectedWithPredicate for more information
Finds a selected tree by a predicate.
Finds a selected tree by a predicate. The tree does not have to be selected completely, it is only checked whether this selection is contained in the tree.
If multiple trees of the type are found, the last one (i.e. the deepest child) is returned.
Returns a list of symbols that are used inside the selection but defined outside of it.
Returns a list of symbols that are used inside the selection but defined outside of it.
Returns only inbound dependencies that are directly or indirectly owned
by owner
.
Returns only inbound dependencies that are directly or indirectly owned
by owner
.
Returns inbound dependencies that are owned by the outmost enclosing class or object in the CU.
Returns inbound dependencies that are owned by the outmost enclosing class or object in the CU.
Returns true if the given Tree fully contains this selection.
Returns true if the given Tree fully contains this selection.
Tries to determine if the selected code contains side effects.
Tries to determine if the selected code contains side effects.
Caution: mayHaveSideEffects == false
does not guarantee that selection
has no side effects.
The current implementation does check if the selection contains a reference to a symbol that has a type that is somehow related to Unit.
Returns a list of symbols that are defined inside the selection and used outside of it.
Returns a list of symbols that are defined inside the selection and used outside of it.
This implementation does not use index lookups and therefore returns only outbound dependencies that are used in the same compilation unit. However, this affects only class member definitions.
It also does not cover outbound dependencies that are imported through an import statement in the selected code.
All inbound dependencies that are reassigned in the selected code and used afterwards.
All inbound dependencies that are reassigned in the selected code and used afterwards.
Is true if the selected code could be replaced by a value.
Is true if the selected code could be replaced by a value.
E.g. the selected code represents a value although it consists
of more than one expression:
def fn = {
/*(*/val a = 2
a * 100/*)*/
}
without changing the methods return value.
it is replaceable by
200
Note, this implementation assumes that the code has no side effects.
Is true if the selected code contains only value definitions.
Is true if the selected code contains only value definitions.
Tries to find the selected SymTree: first it is checked if the selection fully contains a SymTree, if true, the first selected is returned.
Tries to find the selected SymTree: first it is checked if the selection fully contains a SymTree, if true, the first selected is returned. Otherwise the result of findSelectedOfType[SymTree] is returned.
Returns all symbols that are either used or defined in the selected trees and their children.
Returns all symbols that are either used or defined in the selected trees and their children.
Returns all selected trees that are not children of other selected trees.
Returns all selected trees that are not children of other selected trees.