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(tok: FormatToken, noTrailingCommas: Boolean = false)(implicit line: Line): Policy
  5. def UnindentAtExclude(exclude: Set[Token], indent: Length): Pf
  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(ownerSet: Set[Tree], lastToken: Token): Policy
  12. def decideNewlinesOnlyAfterClose(split: Split)(close: Token): Pf
  13. def decideNewlinesOnlyAfterToken(token: Token): Pf
  14. def decideNewlinesOnlyBeforeClose(split: Split)(close: Token): Pf
  15. def defnSiteLastToken(close: FormatToken, tree: Tree): Token
  16. def delayedBreakPolicy(leftCheck: Option[(Token) => Boolean])(onBreakPolicy: Policy)(implicit line: Line): Policy
  17. val dequeueSpots: Set[TokenHash]
  18. implicit val dialect: Dialect
  19. def distance(left: Token, right: Token): Int
  20. val emptyQueueSpots: Set[TokenHash]
  21. final def endOfSingleLineBlock(start: FormatToken)(implicit style: ScalafmtConfig): Token
    Annotations
    @tailrec()
  22. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  25. def findArgsFor(ft: FormatToken, argss: Seq[Seq[Tree]]): Option[Seq[Tree]]
  26. final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) => Boolean): Option[FormatToken]
    Annotations
    @tailrec()
  27. val forceConfigStyle: Set[Tree]
  28. def functionExpire(function: Function): (Token, ExpiresOn)
  29. def getApplyArgs(formatToken: FormatToken): (Tree, Seq[Tree])
  30. def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false): Num
  31. def getCaseArrow(term: Case): FormatToken
  32. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  33. def getElseChain(term: If): Seq[Token]
    Annotations
    @inline()
  34. def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): Set[Range]
  35. def getForceConfigStyle: (Set[Tree], Set[TokenHash])
  36. def getFuncArrow(term: Function): Option[FormatToken]
  37. def getLambdaAtSingleArgCallSite(ft: FormatToken)(implicit style: ScalafmtConfig): Option[Function]
  38. def getNoSplit(ft: FormatToken, spaceOk: Boolean)(implicit style: ScalafmtConfig): Modification
  39. def getOptimalTokenFor(ft: FormatToken): Token
  40. def getOptimalTokenFor(token: Token): Token
  41. def getSelectsLastToken(dot: Dot): FormatToken

    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.

  42. def getSpaceAndNewlineAfterCurlyLambda(newlines: Int)(implicit style: ScalafmtConfig): (Boolean, NewlineT)
  43. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  44. val importTokens: Set[Token]
  45. def infixIndent(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken, isNewline: Boolean)(implicit style: ScalafmtConfig): Int
  46. def infixIndent(owner: ApplyInfix, formatToken: FormatToken, isNewline: Boolean)(implicit style: ScalafmtConfig): Int
  47. def infixSplit(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken)(implicit line: Line, style: ScalafmtConfig): Seq[Split]
  48. def infixSplit(owner: ApplyInfix, formatToken: FormatToken)(implicit line: Line, style: ScalafmtConfig): Seq[Split]
  49. val initStyle: ScalafmtConfig
  50. def insideBlock(start: FormatToken, end: Token, matches: (Token) => Boolean): Set[Token]
  51. def isBinPack(owner: Tree): Boolean
  52. def isEmptyFunctionBody(tree: Tree): Boolean
  53. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  54. 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

  55. def isMarginizedString(token: Token): Boolean
  56. def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
  57. def isTripleQuote(token: Token): Boolean
  58. final def leadingComment(formatToken: FormatToken): Token
    Annotations
    @tailrec()
  59. def matching(token: Token): Token
    Annotations
    @inline()
  60. def matchingOpt(token: Token): Option[Token]
    Annotations
    @inline()
  61. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  62. def newlinesOnlyBeforeClosePolicy(close: Token)(implicit line: Line): Policy
  63. def next(tok: FormatToken): FormatToken
    Annotations
    @inline()
  64. def nextNonComment(curr: FormatToken): FormatToken
  65. final def nextNonCommentSameLine(curr: FormatToken): FormatToken
    Annotations
    @tailrec()
  66. final def nextNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
    Annotations
    @tailrec()
  67. def noOptimizationZones(tree: Tree): Set[Token]
  68. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  69. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  70. def opensConfigStyle(formatToken: FormatToken): Boolean
  71. val optionalNewlines: Set[TokenHash]
  72. def owners(token: Token): Tree
    Annotations
    @inline()
  73. val packageTokens: Set[Token]
  74. def parensRange(open: Token): Range
  75. def penalizeAllNewlines(expire: Token, penalty: Int, penalizeLambdas: Boolean = true, ignore: (FormatToken) => Boolean = _ => false, penaliseNewlinesInsideTokens: Boolean = false)(implicit line: Line): Policy
  76. def penalizeNewlineByNesting(from: Token, to: Token)(implicit line: Line): Policy
  77. def prev(tok: FormatToken): FormatToken
    Annotations
    @inline()
  78. def prevNonComment(curr: FormatToken): FormatToken
  79. final def prevNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
    Annotations
    @tailrec()
  80. final def rhsOptimalToken(start: FormatToken)(implicit style: ScalafmtConfig): Token
    Annotations
    @tailrec()
  81. val runner: ScalafmtRunner
  82. final def startsNewBlock(t: Token): Boolean
  83. final def startsStatement(tok: FormatToken): Boolean
    Annotations
    @tailrec()
  84. val statementStarts: Map[TokenHash, Tree]
  85. def styleAt(tree: Tree): ScalafmtConfig
  86. val styleMap: StyleMap
  87. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  88. def templateCurly(template: Template): Option[Token]
  89. def templateCurly(owner: Tree): Token
  90. def toString(): String
    Definition Classes
    AnyRef → Any
  91. val tokens: FormatTokens
  92. val tree: Tree
  93. final def vAlignDepth(tree: Tree): Int
  94. def verticalMultiline(owner: Tree, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]

    Implementation for verticalMultiline

  95. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  96. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  97. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  98. def xmlSpace(owner: Tree): Modification
  99. object :chain:
  100. object :owner:

Inherited from AnyRef

Inherited from Any

Ungrouped