object TreeOps
Stateless helper functions on scala.meta.Tree.
- Alphabetic
- By Inheritance
- TreeOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assertValidParens(open: Token, close: Token): Unit
- def childOf(tok: Token, tree: Tree, owners: Map[TokenHash, Tree]): Boolean
-
final
def
childOf(child: Tree, tree: Tree): Boolean
- Annotations
- @tailrec()
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def defBody(tree: Tree): Option[Tree]
- def defDefReturnType(tree: Tree): Option[Type]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
existsChild(f: (Tree) ⇒ Boolean)(tree: Tree): Boolean
Returns true tree has a child for which f(child) is true.
- def extractStatementsIfAny(tree: Tree): Seq[Tree]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def findSiblingGuard(generator: Generator): Option[Guard]
- def getApplyArgs(formatToken: FormatToken, leftOwner: Tree): (Tree, Seq[Tree])
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDequeueSpots(tree: Tree): Set[TokenHash]
- def getEnumStatements(enums: Seq[Enumerator]): Seq[Enumerator]
-
def
getMatchingParentheses(tokens: Tokens): Map[TokenHash, Token]
Finds matching parens [({})].
Finds matching parens [({})].
Contains lookup keys in both directions, opening [({ and closing })].
-
def
getOwners(tree: Tree): Map[TokenHash, Tree]
Creates lookup table from token offset to its closest scala.meta tree.
-
final
def
getSelectChain(child: Tree, accum: Vector[Select]): Vector[Select]
- Annotations
- @tailrec()
- final def getSelectChain(select: Select): Vector[Select]
- def getStatementStarts(tree: Tree): Map[TokenHash, Tree]
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isApplyInfix(op: Ident, owner: Tree): Boolean
- def isBinPackDefnSite(tree: Tree): Boolean
- def isBlockFunction(fun: Function): Boolean
- def isCallSite(tree: Tree): Boolean
- def isChainApplyParent(parent: Tree, child: Tree): Boolean
- def isDefDef(tree: Tree): Boolean
- def isDefnOrCallSite(tree: Tree): Boolean
-
def
isDefnSite(tree: Tree): Boolean
Returns
trueif the Tree is a definition siteReturns
trueif the Tree is a definition siteCurrently, this includes everything from classes and defs to type applications
-
def
isDefnSiteWithParams(tree: Tree): Boolean
Returns
trueif the Tree is a class, trait or defReturns
trueif the Tree is a class, trait or defFor classes this includes primary and secondary Ctors.
- def isFirstOrLastToken(token: Token, owner: Tree): Boolean
- def isImporterOrDefnOrCallSite(tree: Tree): Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isModPrivateProtected(tree: Tree): Boolean
- def isProcedureSyntax(defn: Def): Boolean
-
def
isSuperfluousParenthesis(open: Token, owner: Tree): Boolean
Returns true if open is "unnecessary".
Returns true if open is "unnecessary".
An opening parenthesis is unnecessary if without it and its closing parenthesis can be removed without changing the AST. For example:
(a(1))will parse into the same tree asa(1). - def isTopLevel(tree: Tree): Boolean
-
final
def
isTopLevelInfixApplication(child: Tree): Boolean
- Annotations
- @tailrec()
- def isTuple(tree: Tree): Boolean
- def isTypeVariant(tree: Tree): Boolean
- def isXmlBrace(owner: Tree): Boolean
-
final
def
lastLambda(first: Function): Function
- Annotations
- @tailrec()
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nestedApplies(tree: Tree): Int
How many parents of tree are Term.Apply?
- def nestedSelect(tree: Tree): Int
- def noSpaceBeforeOpeningParen(tree: Tree): Boolean
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
parents(tree: Tree, accum: Seq[Tree] = Seq.empty[Tree]): Seq[Tree]
- Annotations
- @tailrec()
- val splitApplyIntoLhsAndArgs: PartialFunction[Tree, (Tree, Seq[Tree])]
- val splitApplyIntoLhsAndArgsLifted: (Tree) ⇒ Option[(Tree, Seq[Tree])]
- def startsSelectChain(tree: Tree): Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
topTypeWith(typeWith: With): With
- Annotations
- @tailrec()
-
def
treeDepth(tree: Tree): Int
Calculates depth to deepest child in tree.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def withChain(top: Tree): Seq[With]
- object MaybeTopLevelStat