object TreeOps

Stateless helper functions on scala.meta.Tree.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TreeOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type CallParts = (Tree, Either[Seq[Tree], Seq[Seq[Tree]]])
  2. type DefnParts = (Seq[Mod], Name, Seq[Param], Seq[Seq[Param]])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def assertValidParens(open: Token, close: Token): Unit
  6. def childOf(tok: Token, tree: Tree, owners: Map[TokenHash, Tree]): Boolean
  7. final def childOf(child: Tree, tree: Tree): Boolean
    Annotations
    @tailrec()
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def defBody(tree: Tree): Option[Tree]
  10. def defDefReturnType(tree: Tree): Option[Type]
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def existsChild(f: (Tree) => Boolean)(tree: Tree): Boolean

    Returns true tree has a child for which f(child) is true.

  14. def existsParentOfType[A <: Tree](tree: Tree)(implicit classifier: Classifier[Tree, A]): Boolean

    Returns true if a matching ancestor of a given type exists.

    Returns true if a matching ancestor of a given type exists.

    Annotations
    @inline()
  15. def extractStatementsIfAny(tree: Tree): Seq[Tree]
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. def findSiblingGuard(generator: Generator): Option[Guard]
  18. def findTreeWithParent(tree: Tree)(pred: (Tree) => Option[Boolean]): Option[Tree]

    Returns first ancestor whose parent matches the given predicate.

    Returns first ancestor whose parent matches the given predicate.

    Annotations
    @tailrec()
  19. def findTreeWithParentOfType[A <: Tree](tree: Tree)(implicit classifier: Classifier[Tree, A]): Option[Tree]

    Returns first ancestor with a parent of a given type.

  20. def getAssignAtSingleArgCallSite(tree: Tree): Option[Assign]
  21. def getBlockSingleStat(b: Block): Option[Stat]
  22. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def getDequeueSpots(tree: Tree): Set[TokenHash]
  24. def getEnumStatements(enums: Seq[Enumerator]): Seq[Enumerator]
  25. def getMatchingParentheses(tokens: Tokens): Map[TokenHash, Token]

    Finds matching parens [({})].

    Finds matching parens [({})].

    Contains lookup keys in both directions, opening [({ and closing })].

  26. def getOwners(tree: Tree): Map[TokenHash, Tree]

    Creates lookup table from token offset to its closest scala.meta tree.

  27. final def getSelectChain(child: Tree, accum: Vector[Select]): Vector[Select]
    Annotations
    @tailrec()
  28. def getStatementStarts(tree: Tree): Map[TokenHash, Tree]
  29. def getTermLineSpan(b: Tree): Int
  30. def getTermSingleStat(t: Term): Option[Tree]
  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. final def isApplyInfix(op: Ident, owner: Tree): Boolean
  33. def isBlockFunction(fun: Function): Boolean
    Annotations
    @tailrec()
  34. def isCallSite(tree: Tree): Boolean
  35. def isChainApplyParent(parent: Tree, child: Tree): Boolean
  36. def isDefDef(tree: Tree): Boolean
  37. def isDefnOrCallSite(tree: Tree): Boolean
  38. def isDefnSite(tree: Tree): Boolean

    Returns true if the Tree is a definition site

    Returns true if the Tree is a definition site

    Currently, this includes everything from classes and defs to type applications

  39. def isDefnSiteWithParams(tree: Tree): Boolean

    Returns true if the Tree is a class, trait or def

    Returns true if the Tree is a class, trait or def

    For classes this includes primary and secondary Ctors.

  40. def isExplicitImplicit(m: Mod): Boolean
  41. def isFirstOrLastToken(token: Token, owner: Tree): Boolean
  42. def isFunctionWithBraces(fun: Function): Boolean
  43. def isHiddenImplicit(m: Mod): Boolean

    In cases like:

    In cases like:

      class X(
        implicit
        private[this] val i1: Int,
        private[this] var i2: String
    )

    val i1, and var i2 have a Mod.Implicit with empty tokens.

  44. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  45. def isModPrivateProtected(tree: Tree): Boolean
  46. def isProcedureSyntax(defn: Def): Boolean
  47. def isSingleElement(elements: List[Tree], value: Tree): Boolean
  48. def isSuperfluousParenthesis(open: LeftParen, owner: Tree): Boolean
  49. 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 as a(1).

  50. def isTopLevel(tree: Tree): Boolean
  51. final def isTopLevelInfixApplication(child: Tree): Boolean
    Annotations
    @tailrec()
  52. def isTuple(tree: Tree): Boolean
  53. def isTypeVariant(tree: Tree): Boolean
  54. def isXmlBrace(owner: Tree): Boolean
  55. final def lastLambda(first: Function): Function
    Annotations
    @tailrec()
  56. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  57. def nestedApplies(tree: Tree): Int

    How many parents of tree are Term.Apply?

  58. def nestedSelect(tree: Tree): Int
  59. def noSpaceBeforeOpeningParen(tree: Tree): Boolean
  60. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  61. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  62. final def numParents(tree: Tree, accum: Int = 0): Int
    Annotations
    @tailrec()
  63. val splitCallIntoParts: PartialFunction[Tree, CallParts]
  64. val splitDefnIntoParts: PartialFunction[Tree, DefnParts]
  65. def startsSelectChain(tree: Tree): Boolean
  66. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  67. def toString(): String
    Definition Classes
    AnyRef → Any
  68. def topTypeWith(typeWith: With): With
    Annotations
    @tailrec()
  69. def treeDepth(tree: Tree): Int

    Calculates depth to deepest child in tree.

  70. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  71. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  72. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  73. def withChain(top: Tree): Seq[With]
  74. object MaybeTopLevelStat
  75. object SplitCallIntoParts
  76. object SplitDefnIntoParts

Inherited from AnyRef

Inherited from Any

Ungrouped