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

Type Members

  1. class ExtractFromMeta[A] extends AnyRef

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. val ExtractAndOrTypeRhsIdentLeft: ExtractFromMeta[Type]
  5. val LambdaAtSingleArgCallSite: ExtractFromMeta[FunctionTerm]
  6. val StartsStatementRight: ExtractFromMeta[Tree]
  7. def UnindentAtExclude(exclude: Set[Token], indent: Length): Pf
  8. val argumentStarts: Map[TokenHash, Tree]
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def binPackParentConstructorSplits(isFirstCtor: Boolean, owners: => Set[Tree], rhs: => Option[Tree], lastToken: Token, indentLen: Int, extendsThenWith: => Boolean = false)(implicit fileLine: FileLine, ft: FormatToken, style: ScalafmtConfig): Seq[Split]
  11. def canStartSelectChain(thisSelectLike: SelectLike, nextSelect: Option[Term], lastApply: Tree)(implicit style: ScalafmtConfig): Boolean
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. def couldUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
  14. def ctorWithChain(ownerSet: Set[Tree], lastToken: Token)(implicit style: ScalafmtConfig): Policy
  15. def decideNewlinesOnlyAfterClose(split: Split)(close: Token)(implicit fileLine: FileLine): Policy
  16. def decideNewlinesOnlyAfterClose(close: Token)(implicit fileLine: FileLine): Policy
  17. def decideNewlinesOnlyAfterToken(token: Token)(implicit fileLine: FileLine): Policy
  18. def decideNewlinesOnlyBeforeClose(split: Split)(close: Token)(implicit fileLine: FileLine): Policy
  19. def decideNewlinesOnlyBeforeClose(close: Token)(implicit fileLine: FileLine): Policy
  20. def decideNewlinesOnlyBeforeCloseOnBreak(close: Token)(implicit fileLine: FileLine): Policy
  21. def defnSiteLastToken(close: FormatToken, tree: Tree): Token
  22. implicit val dialect: Dialect
  23. def distance(left: Token, right: Token): Int
  24. val emptyQueueSpots: Set[TokenHash]
  25. final def endOfSingleLineBlock(start: FormatToken)(implicit style: ScalafmtConfig): Token
    Annotations
    @tailrec()
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  28. def existsBlockIfWithoutElse(tree: Tree): Boolean
  29. def existsBlockIfWithoutElse(t: If): Boolean
  30. val filename: String
  31. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  32. def findArgsFor[A <: Tree](token: Token, argss: Seq[Seq[A]]): Option[Seq[A]]
  33. final def findFirst(start: FormatToken, end: Int)(f: (FormatToken) => Boolean): Option[FormatToken]
    Annotations
    @tailrec()
  34. final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) => Boolean): Option[FormatToken]
    Annotations
    @inline()
  35. def findFirstOnRight[A](start: FormatToken, end: Token)(implicit classifier: Classifier[Token, A]): Option[Token]
  36. final def findLastApplyAndNextSelect(tree: Tree, enclosed: Boolean): (Tree, Option[SelectLike])
  37. final def findLeftInfix(app: InfixApp): InfixApp
    Annotations
    @tailrec()
  38. def findPrevSelect(tree: SelectLike, enclosed: Boolean = true): Option[SelectLike]
  39. final def findPrevSelect(tree: Tree, enclosed: Boolean): Option[SelectLike]
    Annotations
    @tailrec()
  40. def findTemplateGroupOnRight[A](func: (TemplateSupertypeGroup) => A)(template: Template)(implicit ft: FormatToken): Option[A]
  41. final def findXmlLastLineIndent(ft: FormatToken): Int
    Annotations
    @tailrec()
  42. val forceConfigStyle: Set[Tree]
  43. def functionExpire(function: FunctionTerm): (Token, ExpiresOn)
  44. def getApplyArgs(ft: FormatToken, isRight: Boolean)(implicit style: ScalafmtConfig): TreeArgs
  45. def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false)(implicit style: ScalafmtConfig): Num
  46. def getCaseArrow(term: TypeCase): FormatToken
  47. def getCaseArrow(term: Case): FormatToken
  48. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  49. def getClosingIfEnclosedInMatching(tree: Tree): Option[Token]
  50. def getElseChain(term: If): Seq[Token]
    Annotations
    @inline()
  51. def getEndOfBlock(ft: FormatToken, parensToo: Boolean)(implicit style: ScalafmtConfig): Option[Token]
  52. def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): TokenRanges
  53. def getForceConfigStyle: (Set[Tree], Set[TokenHash])
  54. def getFuncArrow(term: FunctionTerm): Option[FormatToken]
  55. def getInfixSplitsBeforeLhs(lhsApp: InfixApp, ft: FormatToken, newStmtMod: Option[Modification] = None)(implicit style: ScalafmtConfig): Seq[Split]
  56. def getKwMatchAfterDot(ft: FormatToken): KwMatch
  57. def getLambdaAtSingleArgCallSite(ft: FormatToken): Option[FunctionTerm]
  58. def getLastNonTrivialToken(tree: Tree): Token
  59. def getLastNonTrivialTokenOpt(tree: Tree): Option[Token]
  60. def getLastToken(tree: Tree): Token
  61. def getLastTokenOpt(tree: Tree): Option[Token]
  62. def getMatchDot(tree: Match): Option[FormatToken]
  63. def getMidInfixToken(app: InfixApp): Token
  64. def getNoSplit(ft: FormatToken, spaceOk: Boolean)(implicit style: ScalafmtConfig): Modification
  65. def getOptimalTokenFor(ft: FormatToken): Token
  66. def getOptimalTokenFor(token: Token): Token
  67. def getSingleLineInfixPolicy(end: Token): Policy
  68. def getSpaceAndNewlineAfterCurlyLambda(newlines: Int)(implicit style: ScalafmtConfig): (Boolean, NewlineT)
  69. def getSplitsForTypeBounds(ft: FormatToken, noNLMod: => Modification, typeOwner: Tree, boundEndOpt: Option[Token])(implicit style: ScalafmtConfig): Seq[Split]
  70. def getSplitsForTypeBounds(ft: FormatToken, noNLMod: => Modification, tparam: Param, bounds: (Param) => Seq[Type])(implicit style: ScalafmtConfig): Seq[Split]
  71. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  72. final def inSelectChain(prevSelect: Option[SelectLike], thisSelect: SelectLike, lastApply: Tree)(implicit style: ScalafmtConfig): Boolean

    Checks if an earlier select started the chain

    Checks if an earlier select started the chain

    Annotations
    @tailrec()
  73. def insideBlock(matches: (FormatToken) => Option[Token])(start: FormatToken, end: Token): TokenRanges
  74. def insideBlock(start: FormatToken, end: Token, matches: (FormatToken) => Boolean): TokenRanges
  75. def insideBlock[A](start: FormatToken, end: Token)(implicit classifier: Classifier[Token, A]): TokenRanges
  76. def insideBracesBlock(start: FormatToken, end: Token, parensToo: Boolean = false)(implicit style: ScalafmtConfig): TokenRanges
  77. def insideInfixSplit(app: InfixApp, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]
  78. def isBlockWithoutOptionalBraces(t: Block): Boolean
  79. def isCaseBodyEnclosedAsBlock(ft: FormatToken, caseStat: CaseTree)(implicit style: ScalafmtConfig): Boolean
  80. def isEmptyFunctionBody(tree: Tree): Boolean
  81. def isEnclosedInMatching(tree: Tree): Boolean
  82. def isEnclosedInMatching(tree: Tree, open: Token, close: Token): Boolean
  83. final def isInfixRhs(ft: FormatToken): Boolean
  84. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  85. 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

  86. def isRightImplicitOrUsingSoftKw(ft: FormatToken, soft: SoftKeywordClasses): Boolean
  87. def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
  88. final def leadingComment(tree: Tree): FormatToken
    Annotations
    @inline()
  89. final def leadingComment(ft: FormatToken): FormatToken
    Annotations
    @inline()
  90. def mustUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
  91. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  92. def noOptimizationZones(): Set[Token]
  93. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  94. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  95. def opensConfigStyle(ft: => FormatToken, whenSourceIgnored: Boolean = false)(implicit style: ScalafmtConfig): Boolean
  96. def opensConfigStyleImplicitParamList(formatToken: FormatToken)(implicit style: ScalafmtConfig): Boolean

    Works for using as well

  97. def opensImplicitParamList(ft: FormatToken, args: Seq[Tree]): Boolean

    Works for using as well

  98. def opensImplicitParamList(ft: FormatToken): Option[Seq[Param]]
  99. val optionalNewlines: Set[TokenHash]
  100. def owners(token: Token): Tree
    Annotations
    @inline()
  101. def parensTuple(token: Token): TokenRanges
  102. def penalizeNewlineByNesting(from: Token, to: Token)(implicit fileLine: FileLine): Policy
  103. final def rhsOptimalToken(start: FormatToken)(implicit style: ScalafmtConfig): Token
  104. val runner: ScalafmtRunner
  105. def splitOneArgOneLine(close: Token, owner: Tree)(implicit fileLine: FileLine, style: ScalafmtConfig): Policy
    Annotations
    @inline()
  106. def splitOneArgPerLineAfterComma(owner: Tree): Pf
  107. def splitOneArgPerLineAfterCommaOnBreak(comma: Token): Policy
  108. def splitOneArgPerLineBeforeComma(owner: Tree): Pf
  109. final def startsNewBlockOnRight(ft: FormatToken): Boolean
  110. final def startsStatement(token: Token): Option[Tree]
    Annotations
    @inline()
  111. final def startsStatement(tok: FormatToken): Option[Tree]
    Annotations
    @inline()
  112. val styleMap: StyleMap
  113. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  114. def templateCurly(template: Template): Option[Token]
  115. def templateCurlyFt(template: Template): Option[FormatToken]
  116. def templateCurlyOrLastNonTrivial(template: Template): Token
  117. def templateDerivesOrCurlyOrLastNonTrivial(template: Template)(implicit ft: FormatToken): Token
  118. def toString(): String
    Definition Classes
    AnyRef → Any
  119. val tokens: FormatTokens
  120. val topSourceTree: Tree
  121. final def trailingComment(ft: FormatToken, end: Int): FormatToken
    Annotations
    @inline()
  122. def typeTemplateSplits(template: Template, indentIfSecond: Int)(implicit fileLine: FileLine, ft: FormatToken, style: ScalafmtConfig): Seq[Split]
  123. def verticalMultiline(owner: Tree, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]

    Implementation for verticalMultiline

  124. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  125. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  126. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  127. def withIndentOnXmlSpliceStart(ft: FormatToken, splits: Seq[Split])(implicit style: ScalafmtConfig): Seq[Split]
  128. def withIndentOnXmlStart(tok: Start, splits: Seq[Split])(implicit style: ScalafmtConfig): Seq[Split]
  129. def xmlSpace(owner: Tree): Modification
  130. object CtrlBodySplits
  131. object GetSelectLike
  132. object OptionalBraces

Inherited from AnyRef

Inherited from Any

Ungrouped