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. def getAssignAtSingleArgCallSite(tree: Tree): Option[Assign]

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

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

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

    Permalink
  23. def getLambdaAtSingleArgCallSite(tree: Tree): Option[Function]

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

    Permalink

    Finds matching parens [({})].

    Finds matching parens [({})].

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

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

    Permalink

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

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

    Permalink
    Annotations
    @tailrec()
  27. def getStatementStarts(tree: Tree): Map[TokenHash, Tree]

    Permalink
  28. def hashCode(): Int

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

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

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

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

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

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

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

    Permalink
  36. 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

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

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

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

    Permalink
  40. final def isInstanceOf[T0]: Boolean

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

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

    Permalink
  43. def isSuperfluousParenthesis(open: LeftParen, owner: Tree): Boolean

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

  45. def isTopLevel(tree: Tree): Boolean

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

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

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

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

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

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

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

    Permalink

    How many parents of tree are Term.Apply?

  53. def nestedSelect(tree: Tree): Int

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

    Permalink
  55. final def notify(): Unit

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

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

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

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

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

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

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

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

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

    Permalink

    Calculates depth to deepest child in tree.

  65. final def wait(): Unit

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

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

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

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped