Class

org.scalafmt.internal

FormatOps

Related Doc: package internal

Permalink

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

Instance Constructors

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

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. object :chain:

    Permalink
  4. object :owner:

    Permalink
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def OneArgOneLineSplit(open: Token, noTrailingCommas: Boolean = false)(implicit line: Line): Policy

    Permalink
  7. def UnindentAtExclude(exclude: Set[Token], indent: Length): PartialFunction[Decision, Decision]

    Permalink
  8. val argumentStarts: Map[TokenHash, Tree]

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def binPackParentConstructorSplits(owners: Set[Tree], lastToken: Token, indent: Int)(implicit line: Line): Seq[Split]

    Permalink
  11. def chainOptimalToken(chain: Vector[Select]): Token

    Permalink
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def ctorWithChain(owners: Set[Tree], lastToken: Token): Policy

    Permalink
  14. def decideNewlineAfterToken(close: Token): PartialFunction[Decision, Decision]

    Permalink
  15. def defnSiteLastToken(open: Token, tree: Tree): Token

    Permalink
  16. val dequeueSpots: Set[TokenHash]

    Permalink
  17. implicit val dialect: Dialect

    Permalink
  18. def distance(left: Token, right: Token): Int

    Permalink
  19. val emptyQueueSpots: Set[TokenHash]

    Permalink
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) ⇒ Boolean): Option[FormatToken]

    Permalink
    Annotations
    @tailrec()
  24. val forceConfigStyle: Set[Tree]

    Permalink
  25. def functionExpire(function: Function): (Token, ExpiresOn)

    Permalink
  26. def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false): Num

    Permalink
  27. def getArrow(caseStat: Case): Token

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

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def getElseChain(term: If): Vector[KwElse]

    Permalink
  30. def getExcludeIf(end: Token, cond: (Token) ⇒ Boolean = _.is[T.RightBrace]): Set[Range]

    Permalink
  31. def getForceConfigStyle: (Set[Tree], Set[TokenHash])

    Permalink
  32. def getRightAttachedComment(token: Token): Token

    Permalink
  33. def getSelectsLastToken(dot: Dot): Token

    Permalink

    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.

  34. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  35. val importTokens: Set[Token]

    Permalink
  36. def infixSplit(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken)(implicit line: Line): Split

    Permalink
  37. def infixSplit(owner: ApplyInfix, formatToken: FormatToken)(implicit line: Line): Split

    Permalink
  38. val initStyle: ScalafmtConfig

    Permalink
  39. def insideBlock(start: FormatToken, end: Token, matches: (Token) ⇒ Boolean): Set[Token]

    Permalink
  40. def isBinPack(owner: Tree): Boolean

    Permalink
  41. def isEmptyFunctionBody(tree: Tree): Boolean

    Permalink
  42. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  43. def isJsNative(jsToken: Token): Boolean

    Permalink

    js.native is very special in Scala.js.

    js.native is very special in Scala.js.

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

  44. def isMarginizedString(token: Token): Boolean

    Permalink
  45. def isSingleIdentifierAnnotation(tok: FormatToken): Boolean

    Permalink
  46. def isTripleQuote(token: Token): Boolean

    Permalink
  47. def lastTokenInChain(chain: Vector[Select]): Token

    Permalink
  48. final def leadingComment(formatToken: FormatToken): Token

    Permalink
    Annotations
    @tailrec()
  49. lazy val leftTok2tok: Map[Token, FormatToken]

    Permalink
  50. def matching(token: Token): Token

    Permalink
    Annotations
    @inline()
  51. val matchingParentheses: Map[TokenHash, Token]

    Permalink
  52. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  53. def newlineOnTokenPolicy(close: Token): Policy

    Permalink
  54. def next(tok: FormatToken): FormatToken

    Permalink
  55. def next(tok: Token): Token

    Permalink
  56. def nextNonComment(curr: FormatToken): FormatToken

    Permalink
  57. final def nextNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)

    Permalink
    Annotations
    @tailrec()
  58. def noOptimizationZones(tree: Tree): Set[Token]

    Permalink
  59. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  61. def opensConfigStyle(formatToken: FormatToken): Boolean

    Permalink
  62. val optionalNewlines: Set[TokenHash]

    Permalink
  63. def owners(token: Token): Tree

    Permalink
    Annotations
    @inline()
  64. val ownersMap: Map[TokenHash, Tree]

    Permalink
  65. val packageTokens: Set[Token]

    Permalink
  66. def parensRange(open: Token): Range

    Permalink
  67. def penalizeAllNewlines(expire: Token, penalty: Int, penalizeLambdas: Boolean = true, ignore: (FormatToken) ⇒ Boolean = _ => false, penaliseNewlinesInsideTokens: Boolean = false)(implicit line: Line): Policy

    Permalink
  68. def penalizeNewlineByNesting(from: Token, to: Token)(implicit line: Line): Policy

    Permalink
  69. def prev(tok: FormatToken): FormatToken

    Permalink
  70. def prev(tok: Token): Token

    Permalink
  71. def prevNonComment(curr: FormatToken): FormatToken

    Permalink
  72. final def prevNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)

    Permalink
    Annotations
    @tailrec()
  73. final def rhsOptimalToken(start: FormatToken): Token

    Permalink
    Annotations
    @tailrec()
  74. val runner: ScalafmtRunner

    Permalink
  75. def safeFilterNewlines(splits: Seq[Split])(implicit line: Line): Seq[Split]

    Permalink
  76. def selectExpire(dot: Dot): Token

    Permalink

    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.

  77. def skipUnindent(token: Token): Boolean

    Permalink
  78. final def startsNewBlock(t: Token): Boolean

    Permalink
  79. final def startsStatement(tok: FormatToken): Boolean

    Permalink
    Annotations
    @tailrec()
  80. val statementStarts: Map[TokenHash, Tree]

    Permalink
  81. def styleAt(tree: Tree): ScalafmtConfig

    Permalink
  82. val styleMap: StyleMap

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

    Permalink
    Definition Classes
    AnyRef
  84. def templateCurly(template: Template): Option[Token]

    Permalink
  85. def templateCurly(owner: Tree): Token

    Permalink
  86. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  87. lazy val tok2idx: Map[FormatToken, Int]

    Permalink
  88. val tokens: Array[FormatToken]

    Permalink
  89. val tree: Tree

    Permalink
  90. final def vAlignDepth(tree: Tree): Int

    Permalink
  91. def verticalMultiline(owner: Tree, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]

    Permalink

    Implementation for verticalMultiline

  92. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  95. def xmlSpace(owner: Tree): Modification

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped