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. object MaybeTopLevelStat

    Permalink
  5. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

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

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

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

    Permalink

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

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

    Permalink
  16. def finalize(): Unit

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

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

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

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

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

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

    Permalink

    Finds matching parens [({})].

    Finds matching parens [({})].

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

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

    Permalink

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

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

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

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

    Permalink
  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def isApplyInfix(op: Ident, owner: Tree): Boolean

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

    Permalink
  30. def isBlockFunction(fun: Function): Boolean

    Permalink
  31. def isCallSite(tree: Tree): Boolean

    Permalink
  32. def isChainApplyParent(parent: Tree, child: Tree): Boolean

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

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

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

    Permalink

    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

  36. def isDefnSiteWithParams(tree: Tree): Boolean

    Permalink

    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.

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

    Permalink
  38. def isImporterOrDefnOrCallSite(tree: Tree): Boolean

    Permalink
  39. final def isInstanceOf[T0]: Boolean

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

    Permalink
  41. def isProcedureSyntax(defn: Def): Boolean

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

  43. def isTopLevel(tree: Tree): Boolean

    Permalink
  44. final def isTopLevelInfixApplication(child: Tree): Boolean

    Permalink
    Annotations
    @tailrec()
  45. def isTuple(tree: Tree): Boolean

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

    Permalink
  47. def isXmlBrace(owner: Tree): Boolean

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

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

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

    Permalink

    How many parents of tree are Term.Apply?

  51. def nestedSelect(tree: Tree): Int

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

    Permalink
  53. final def notify(): Unit

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  61. def topTypeWith(typeWith: With): With

    Permalink
    Annotations
    @tailrec()
  62. def treeDepth(tree: Tree): Int

    Permalink

    Calculates depth to deepest child in tree.

  63. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. def withChain(top: Tree): Seq[With]

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped