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, baseStyle: ScalafmtConfig, filename: String = "")

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 UnindentAtExclude(exclude: Set[Token], indent: Length): Pf
  5. val argumentStarts: Map[TokenHash, Tree]
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def binPackParentConstructorSplits(chain: Either[Template, Seq[With]], lastToken: Token, indentLen: Int)(implicit line: Line, style: ScalafmtConfig): Seq[Split]
  8. def canStartSelectChain(thisSelect: Select, nextSelect: Option[Select], lastApply: Tree)(implicit style: ScalafmtConfig): Boolean
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def couldUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
  11. def ctorWithChain(ownerSet: Set[Tree], lastToken: Token)(implicit style: ScalafmtConfig): Policy
  12. def decideNewlinesOnlyAfterClose(split: Split)(close: Token)(implicit line: Line): Policy
  13. def decideNewlinesOnlyAfterToken(token: Token)(implicit line: Line): Policy
  14. def decideNewlinesOnlyBeforeClose(split: Split)(close: Token)(implicit line: Line): Policy
  15. def decideNewlinesOnlyBeforeClose(close: Token)(implicit line: Line): Policy
  16. def defnSiteLastToken(close: FormatToken, tree: Tree): Token
  17. def delayedBreakPolicy(end: WithPos)(onBreakPolicy: Policy)(implicit line: Line): Policy
  18. def delayedBreakPolicyFactory(onBreakPolicy: Policy): Pf
  19. val dequeueSpots: Set[TokenHash]
  20. implicit val dialect: Dialect
  21. def distance(left: Token, right: Token): Int
  22. val emptyQueueSpots: Set[TokenHash]
  23. final def endOfSingleLineBlock(start: FormatToken)(implicit style: ScalafmtConfig): Token
    Annotations
    @tailrec()
  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  26. val filename: String
  27. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  28. def findArgsFor[A <: Tree](token: Token, argss: Seq[Seq[A]]): Option[Seq[A]]
  29. final def findFirst(start: FormatToken, end: Int)(f: (FormatToken) => Boolean): Option[FormatToken]
    Annotations
    @tailrec()
  30. final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) => Boolean): Option[FormatToken]
  31. final def findLastApplyAndNextSelect(tree: Tree, enclosed: Boolean): (Tree, Option[Select])
  32. final def findLeftInfix(app: InfixApp): InfixApp
    Annotations
    @tailrec()
  33. def findPrevSelect(tree: Select, enclosed: Boolean = true): Option[Select]
  34. final def findPrevSelect(tree: Tree, enclosed: Boolean): Option[Select]
    Annotations
    @tailrec()
  35. final def findToken(ft: FormatToken, iter: (FormatToken) => FormatToken)(f: (FormatToken) => Boolean): Either[FormatToken, FormatToken]
  36. final def findTokenWith[A](ft: FormatToken, iter: (FormatToken) => FormatToken)(f: (FormatToken) => Option[A]): Either[FormatToken, A]
    Annotations
    @tailrec()
  37. final def findXmlLastLineIndent(ft: FormatToken): Int
    Annotations
    @tailrec()
  38. val forceConfigStyle: Set[Tree]
  39. def functionExpire(function: Function): (Token, ExpiresOn)
  40. def getApplyArgs(ft: FormatToken, isRight: Boolean)(implicit style: ScalafmtConfig): (Tree, Seq[Tree])
  41. def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false)(implicit style: ScalafmtConfig): Num
  42. def getCaseArrow(term: Case): FormatToken
  43. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  44. def getClosingIfEnclosedInMatching(tree: Tree): Option[Token]
  45. def getElseChain(term: If): Seq[Token]
    Annotations
    @inline()
  46. def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): TokenRanges
  47. def getForceConfigStyle: (Set[Tree], Set[TokenHash])
  48. def getFuncArrow(term: Function): Option[FormatToken]
  49. def getInfixSplitsBeforeLhs(lhsApp: InfixApp, ft: FormatToken, newStmtMod: Option[Modification] = None)(implicit style: ScalafmtConfig): Seq[Split]
  50. def getLambdaAtSingleArgCallSite(ft: FormatToken)(implicit style: ScalafmtConfig): Option[Function]
  51. def getMidInfixToken(app: InfixApp): Token
  52. def getNoSplit(ft: FormatToken, spaceOk: Boolean)(implicit style: ScalafmtConfig): Modification
  53. def getOptimalTokenFor(ft: FormatToken): Token
  54. def getOptimalTokenFor(token: Token): Token
  55. def getSingleLineInfixPolicy(end: Token): Policy
  56. def getSpaceAndNewlineAfterCurlyLambda(newlines: Int)(implicit style: ScalafmtConfig): (Boolean, NewlineT)
  57. def hasMatching(token: Token): Boolean
    Annotations
    @inline()
  58. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  59. val importTokens: Set[Token]
  60. final def inSelectChain(prevSelect: Option[Select], thisSelect: Select, lastApply: Tree)(implicit style: ScalafmtConfig): Boolean

    Checks if an earlier select started the chain

    Checks if an earlier select started the chain

    Annotations
    @tailrec()
  61. val initStyle: ScalafmtConfig
  62. def insideBlock(start: FormatToken, end: Token, matches: (FormatToken) => Boolean): TokenRanges
  63. def insideBlock[A](start: FormatToken, end: Token)(implicit classifier: Classifier[Token, A]): TokenRanges
  64. def insideInfixSplit(app: InfixApp, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]
  65. def isBinPack(owner: Tree): Boolean
  66. def isCaseBodyEnclosedAsBlock(ft: FormatToken, caseStat: Case)(implicit style: ScalafmtConfig): Boolean
  67. def isEmptyFunctionBody(tree: Tree): Boolean
  68. def isEnclosedInMatching(tree: Tree): Boolean
  69. def isEnclosedInMatching(tree: Tree, open: Token, close: Token): Boolean
  70. final def isInfixRhs(ft: FormatToken): Boolean
  71. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  72. def isJsNative(body: Tree): 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

  73. def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
  74. final def leadingComment(formatToken: FormatToken): FormatToken
  75. def matching(token: Token): Token
    Annotations
    @inline()
  76. def matchingOpt(token: Token): Option[Token]
    Annotations
    @inline()
  77. def mustUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
  78. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  79. def next(tok: FormatToken): FormatToken
    Annotations
    @inline()
  80. final def nextNonComment(curr: FormatToken): FormatToken
  81. final def nextNonCommentSameLine(curr: FormatToken): FormatToken
  82. def noOptimizationZones(tree: Tree): Set[Token]
  83. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  84. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  85. def opensConfigStyle(ft: => FormatToken, whenSourceIgnored: Boolean = false)(implicit style: ScalafmtConfig): Boolean
  86. def opensConfigStyleImplicitParamList(formatToken: FormatToken)(implicit style: ScalafmtConfig): Boolean
  87. def opensImplicitParamList(ft: FormatToken, args: Seq[Tree]): Boolean
  88. def opensImplicitParamList(ft: FormatToken): Option[Seq[Param]]
  89. val optionalNewlines: Set[TokenHash]
  90. def owners(token: Token): Tree
    Annotations
    @inline()
  91. val packageTokens: Set[Token]
  92. def parensTuple(token: Token): TokenRanges
  93. def penalizeNewlineByNesting(from: Token, to: Token)(implicit line: Line): Policy
  94. def prev(tok: FormatToken): FormatToken
    Annotations
    @inline()
  95. final def prevNonComment(curr: FormatToken): FormatToken
  96. final def prevNonCommentSameLine(curr: FormatToken): FormatToken
  97. final def rhsOptimalToken(start: FormatToken)(implicit style: ScalafmtConfig): Token
  98. val runner: ScalafmtRunner
  99. def splitOneArgOneLine(close: Token, owner: Tree)(implicit line: Line, style: ScalafmtConfig): Policy
    Annotations
    @inline()
  100. def splitOneArgPerLineAfterComma(owner: Tree)(implicit style: ScalafmtConfig): Pf
  101. def splitOneArgPerLineBeforeComma(owner: Tree)(implicit style: ScalafmtConfig): Pf
  102. final def startsNewBlockOnRight(ft: FormatToken): Boolean
  103. final def startsStatement(token: Token): Option[Tree]
    Annotations
    @inline()
  104. final def startsStatement(tok: FormatToken): Option[Tree]
    Annotations
    @inline()
  105. def styleAt(tree: Tree): ScalafmtConfig
  106. val styleMap: StyleMap
  107. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  108. def templateCurly(template: Template): Option[Token]
  109. def templateCurly(owner: Tree): Token
  110. def toString(): String
    Definition Classes
    AnyRef → Any
  111. val tokens: FormatTokens
  112. val tree: Tree
  113. def verticalMultiline(owner: Tree, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]

    Implementation for verticalMultiline

  114. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  115. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  116. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  117. def withIndentOnXmlSpliceStart(ft: FormatToken, splits: Seq[Split])(implicit style: ScalafmtConfig): Seq[Split]
  118. def withIndentOnXmlStart(tok: Start, splits: Seq[Split])(implicit style: ScalafmtConfig): Seq[Split]
  119. def xmlSpace(owner: Tree): Modification
  120. object :owner:
  121. object CtrlBodySplits

Inherited from AnyRef

Inherited from Any

Ungrouped