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 defDefReturnType(tree: Tree): Option[Type]

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

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

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

    Permalink

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

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

    Permalink
  14. def finalize(): Unit

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

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

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

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

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

    Permalink

    Finds matching parens [({})].

    Finds matching parens [({})].

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

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

    Permalink

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

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

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

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

    Permalink
  24. def hashCode(): Int

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

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

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

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

    Permalink
  29. final def isInstanceOf[T0]: Boolean

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

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

  32. def isTopLevel(tree: Tree): Boolean

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

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

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

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

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

    Permalink

    How many parents of tree are Term.Apply?

  38. def nestedSelect(tree: Tree): Int

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

    Permalink
  40. final def notify(): Unit

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

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

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

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

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

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

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

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

    Permalink

    Calculates depth to deepest child in tree.

  49. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped