class FormatOps extends AnyRef

Helper functions for generating splits/policies for a given tree.

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

Instance Constructors

  1. new FormatOps(tree: Tree, initStyle: ScalafmtConfig)

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. def OneArgOneLineSplit(open: Token, noTrailingCommas: Boolean = false)(implicit line: Line): Policy
  5. def UnindentAtExclude(exclude: Set[Token], indent: Length): PartialFunction[Decision, Decision]
  6. val argumentStarts: Map[TokenHash, Tree]
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def binPackParentConstructorSplits(owners: Set[Tree], lastToken: Token, indent: Int)(implicit line: Line): Seq[Split]
  9. def chainOptimalToken(chain: Vector[Select]): Token
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def ctorWithChain(owners: Set[Tree], lastToken: Token): Policy
  12. def defnSiteLastToken(open: Token, tree: Tree): Token
  13. val dequeueSpots: Set[TokenHash]
  14. implicit val dialect: Dialect
  15. def distance(left: Token, right: Token): Int
  16. val emptyQueueSpots: Set[TokenHash]
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  20. final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) => Boolean): Option[FormatToken]
    Annotations
    @tailrec()
  21. val forceConfigStyle: Set[Tree]
  22. def functionExpire(function: Function): (Token, ExpiresOn)
  23. def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false): Num
  24. def getArrow(caseStat: Case): Token
  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. final def getElseChain(term: If): Vector[KwElse]
  27. def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): Set[Range]
  28. def getForceConfigStyle: (Set[Tree], Set[TokenHash])
  29. def getRightAttachedComment(token: Token): Token
  30. def getSelectsLastToken(dot: Dot): Token

    Returns last token of select, handles case when select's parent is apply.

    Returns last token of select, handles case when select's parent is apply.

    For example, in: foo.bar[T](1, 2) the last token is the final )

    dot

    the dot owned by the select.

  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. val importTokens: Set[Token]
  33. def infixSplit(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken)(implicit line: Line): Split
  34. def infixSplit(owner: ApplyInfix, formatToken: FormatToken)(implicit line: Line): Split
  35. val initStyle: ScalafmtConfig
  36. def insideBlock(start: FormatToken, end: Token, matches: (Token) => Boolean): Set[Token]
  37. def isBinPack(owner: Tree): Boolean
  38. def isEmptyFunctionBody(tree: Tree): Boolean
  39. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  40. def isJsNative(jsToken: Token): Boolean

    js.native is very special in Scala.js.

    js.native is very special in Scala.js.

    Context: https://github.com/scalameta/scalafmt/issues/108

  41. def isMarginizedString(token: Token): Boolean
  42. def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
  43. def isTripleQuote(token: Token): Boolean
  44. def lastTokenInChain(chain: Vector[Select]): Token
  45. final def leadingComment(formatToken: FormatToken): Token
    Annotations
    @tailrec()
  46. lazy val leftTok2tok: Map[Token, FormatToken]
  47. def matching(token: Token): Token
    Annotations
    @inline()
  48. val matchingParentheses: Map[TokenHash, Token]
  49. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  50. def newlineBeforeClosingCurlyPolicy(close: Token): Policy
  51. def next(tok: FormatToken): FormatToken
  52. def next(tok: Token): Token
  53. def nextNonComment(curr: FormatToken): FormatToken
  54. final def nextNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
    Annotations
    @tailrec()
  55. def noOptimizationZones(tree: Tree): Set[Token]
  56. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  57. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  58. def opensConfigStyle(formatToken: FormatToken): Boolean
  59. val optionalNewlines: Set[TokenHash]
  60. def owners(token: Token): Tree
    Annotations
    @inline()
  61. val ownersMap: Map[TokenHash, Tree]
  62. val packageTokens: Set[Token]
  63. def parensRange(open: Token): Range
  64. def penalizeAllNewlines(expire: Token, penalty: Int, penalizeLambdas: Boolean = true, ignore: (FormatToken) => Boolean = _ => false, penaliseNewlinesInsideTokens: Boolean = false)(implicit line: Line): Policy
  65. def penalizeNewlineByNesting(from: Token, to: Token)(implicit line: Line): Policy
  66. def prev(tok: FormatToken): FormatToken
  67. def prev(tok: Token): Token
  68. def prevNonComment(curr: FormatToken): FormatToken
  69. final def prevNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
    Annotations
    @tailrec()
  70. final def rhsOptimalToken(start: FormatToken): Token
    Annotations
    @tailrec()
  71. val runner: ScalafmtRunner
  72. def safeFilterNewlines(splits: Seq[Split])(implicit line: Line): Seq[Split]
  73. def selectExpire(dot: Dot): Token

    Returns the expire token for the owner of dot.

    Returns the expire token for the owner of dot.

    If the select is part of an apply like

    foo.bar { ... }

    the expire token is the closing }, otherwise it's bar.

  74. def skipUnindent(token: Token): Boolean
  75. final def startsNewBlock(t: Token): Boolean
  76. final def startsStatement(tok: FormatToken): Boolean
    Annotations
    @tailrec()
  77. val statementStarts: Map[TokenHash, Tree]
  78. def styleAt(tree: Tree): ScalafmtConfig
  79. val styleMap: StyleMap
  80. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  81. def templateCurly(template: Template): Option[Token]
  82. def templateCurly(owner: Tree): Token
  83. def toString(): String
    Definition Classes
    AnyRef → Any
  84. lazy val tok2idx: Map[FormatToken, Int]
  85. val tokens: Array[FormatToken]
  86. val tree: Tree
  87. final def vAlignDepth(tree: Tree): Int
  88. def verticalMultiline(owner: Tree, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]

    Implementation for verticalMultiline

  89. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  90. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  91. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  92. def xmlSpace(owner: Tree): Modification
  93. object :chain:
  94. object :owner:

Inherited from AnyRef

Inherited from Any

Ungrouped