class FormatOps extends AnyRef
Helper functions for generating splits/policies for a given tree.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- FormatOps
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new FormatOps(tree: Tree, initStyle: ScalafmtConfig)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def OneArgOneLineSplit(tok: FormatToken, noTrailingCommas: Boolean = false)(implicit line: Line): Policy
- def UnindentAtExclude(exclude: Set[Token], indent: Length): Pf
- val argumentStarts: Map[TokenHash, Tree]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def binPackParentConstructorSplits(owners: Set[Tree], lastToken: Token, indent: Int)(implicit line: Line): Seq[Split]
- def chainOptimalToken(chain: Vector[Select]): Token
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ctorWithChain(ownerSet: Set[Tree], lastToken: Token): Policy
- def decideNewlinesOnlyAfterClose(split: Split)(close: Token): Pf
- def decideNewlinesOnlyAfterToken(token: Token): Pf
- def decideNewlinesOnlyBeforeClose(split: Split)(close: Token): Pf
- def defnSiteLastToken(close: FormatToken, tree: Tree): Token
- def delayedBreakPolicy(leftCheck: Option[(Token) => Boolean])(onBreakPolicy: Policy)(implicit line: Line): Policy
- val dequeueSpots: Set[TokenHash]
- implicit val dialect: Dialect
- def distance(left: Token, right: Token): Int
- val emptyQueueSpots: Set[TokenHash]
- final def endOfSingleLineBlock(start: FormatToken)(implicit style: ScalafmtConfig): Token
- Annotations
- @tailrec()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findArgsFor(ft: FormatToken, argss: Seq[Seq[Tree]]): Option[Seq[Tree]]
- final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) => Boolean): Option[FormatToken]
- Annotations
- @tailrec()
- val forceConfigStyle: Set[Tree]
- def functionExpire(function: Function): (Token, ExpiresOn)
- def getApplyArgs(formatToken: FormatToken): (Tree, Seq[Tree])
- def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false): Num
- def getCaseArrow(term: Case): FormatToken
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getElseChain(term: If): Seq[Token]
- Annotations
- @inline()
- def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): Set[Range]
- def getForceConfigStyle: (Set[Tree], Set[TokenHash])
- def getFuncArrow(term: Function): Option[FormatToken]
- def getLambdaAtSingleArgCallSite(ft: FormatToken)(implicit style: ScalafmtConfig): Option[Function]
- def getNoSplit(ft: FormatToken, spaceOk: Boolean)(implicit style: ScalafmtConfig): Modification
- def getOptimalTokenFor(ft: FormatToken): Token
- def getOptimalTokenFor(token: Token): Token
- 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.
- def getSpaceAndNewlineAfterCurlyLambda(newlines: Int)(implicit style: ScalafmtConfig): (Boolean, NewlineT)
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val importTokens: Set[Token]
- def infixIndent(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken, isNewline: Boolean)(implicit style: ScalafmtConfig): Int
- def infixIndent(owner: ApplyInfix, formatToken: FormatToken, isNewline: Boolean)(implicit style: ScalafmtConfig): Int
- def infixSplit(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken)(implicit line: Line, style: ScalafmtConfig): Seq[Split]
- def infixSplit(owner: ApplyInfix, formatToken: FormatToken)(implicit line: Line, style: ScalafmtConfig): Seq[Split]
- val initStyle: ScalafmtConfig
- def insideBlock(start: FormatToken, end: Token, matches: (Token) => Boolean): Set[Token]
- def isBinPack(owner: Tree): Boolean
- def isEmptyFunctionBody(tree: Tree): Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- def isMarginizedString(token: Token): Boolean
- def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
- def isTripleQuote(token: Token): Boolean
- final def leadingComment(formatToken: FormatToken): Token
- Annotations
- @tailrec()
- def matching(token: Token): Token
- Annotations
- @inline()
- def matchingOpt(token: Token): Option[Token]
- Annotations
- @inline()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newlinesOnlyBeforeClosePolicy(close: Token)(implicit line: Line): Policy
- def next(tok: FormatToken): FormatToken
- Annotations
- @inline()
- def nextNonComment(curr: FormatToken): FormatToken
- final def nextNonCommentSameLine(curr: FormatToken): FormatToken
- Annotations
- @tailrec()
- final def nextNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
- Annotations
- @tailrec()
- def noOptimizationZones(tree: Tree): Set[Token]
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def opensConfigStyle(formatToken: FormatToken): Boolean
- val optionalNewlines: Set[TokenHash]
- def owners(token: Token): Tree
- Annotations
- @inline()
- val packageTokens: Set[Token]
- def parensRange(open: Token): Range
- def penalizeAllNewlines(expire: Token, penalty: Int, penalizeLambdas: Boolean = true, ignore: (FormatToken) => Boolean = _ => false, penaliseNewlinesInsideTokens: Boolean = false)(implicit line: Line): Policy
- def penalizeNewlineByNesting(from: Token, to: Token)(implicit line: Line): Policy
- def prev(tok: FormatToken): FormatToken
- Annotations
- @inline()
- def prevNonComment(curr: FormatToken): FormatToken
- final def prevNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
- Annotations
- @tailrec()
- final def rhsOptimalToken(start: FormatToken)(implicit style: ScalafmtConfig): Token
- Annotations
- @tailrec()
- val runner: ScalafmtRunner
- final def startsNewBlock(t: Token): Boolean
- final def startsStatement(tok: FormatToken): Boolean
- Annotations
- @tailrec()
- val statementStarts: Map[TokenHash, Tree]
- def styleAt(tree: Tree): ScalafmtConfig
- val styleMap: StyleMap
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def templateCurly(template: Template): Option[Token]
- def templateCurly(owner: Tree): Token
- def toString(): String
- Definition Classes
- AnyRef → Any
- val tokens: FormatTokens
- val tree: Tree
- final def vAlignDepth(tree: Tree): Int
- def verticalMultiline(owner: Tree, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]
Implementation for
verticalMultiline - final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def xmlSpace(owner: Tree): Modification
- object :chain:
- object :owner: