Object

org.scalafmt.util

TreeOps

Related Doc: package util

Permalink

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. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def assertValidParens(open: Token, close: Token): Unit

    Permalink
  6. def childOf(tok: Token, tree: Tree, owners: Map[TokenHash, Tree]): Boolean

    Permalink
  7. final def childOf(child: Tree, tree: Tree): Boolean

    Permalink
    Annotations
    @tailrec()
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def defBody(tree: Tree): Option[Tree]

    Permalink
  10. def defDefReturnType(tree: Tree): Option[Type]

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def existsChild(f: (Tree) ⇒ Boolean)(tree: Tree): Boolean

    Permalink

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

  14. def extractStatementsIfAny(tree: Tree): Seq[Tree]

    Permalink
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def findSiblingGuard(generator: Generator): Option[Guard]

    Permalink
  17. def getApplyArgs(formatToken: FormatToken, leftOwner: Tree): (Tree, Seq[Tree])

    Permalink
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def getDequeueSpots(tree: Tree): Set[TokenHash]

    Permalink
  20. def getEnumStatements(enums: Seq[Enumerator]): Seq[Enumerator]

    Permalink
  21. def getMatchingParentheses(tokens: Tokens): Map[TokenHash, Token]

    Permalink

    Finds matching parens [({})].

    Finds matching parens [({})].

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

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

    Permalink

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

  23. final def getSelectChain(child: Tree, accum: Vector[Select]): Vector[Select]

    Permalink
    Annotations
    @tailrec()
  24. final def getSelectChain(select: Select): Vector[Select]

    Permalink
  25. def getStatementStarts(tree: Tree): Map[TokenHash, Tree]

    Permalink
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. def isCallSite(tree: Tree): Boolean

    Permalink
  28. def isDefDef(tree: Tree): Boolean

    Permalink
  29. def isDefnSite(tree: Tree): Boolean

    Permalink
  30. def isFirstOrLastToken(token: Token, owner: Tree): Boolean

    Permalink
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. def isModPrivateProtected(tree: Tree): Boolean

    Permalink
  33. def isSuperfluousParenthesis(open: Token, owner: Tree): Boolean

    Permalink

    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).

  34. def isTopLevel(tree: Tree): Boolean

    Permalink
  35. def isTuple(tree: Tree): Boolean

    Permalink
  36. def isTypeVariant(tree: Tree): Boolean

    Permalink
  37. final def lastLambda(first: Function): Function

    Permalink
    Annotations
    @tailrec()
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. def nestedApplies(tree: Tree): Int

    Permalink

    How many parents of tree are Term.Apply?

  40. def nestedSelect(tree: Tree): Int

    Permalink
  41. def noSpaceBeforeOpeningParen(tree: Tree): Boolean

    Permalink
  42. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  44. final def parents(tree: Tree, accum: Seq[Tree] = Seq.empty[Tree]): Seq[Tree]

    Permalink
    Annotations
    @tailrec()
  45. val splitApplyIntoLhsAndArgs: PartialFunction[Tree, (Tree, Seq[Tree])]

    Permalink
  46. val splitApplyIntoLhsAndArgsLifted: (Tree) ⇒ Option[(Tree, Seq[Tree])]

    Permalink
  47. def startsSelectChain(tree: Tree): Boolean

    Permalink
  48. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. def treeDepth(tree: Tree): Int

    Permalink

    Calculates depth to deepest child in tree.

  51. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped