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, baseStyle: ScalafmtConfig, filename: String = "")
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 UnindentAtExclude(exclude: Set[Token], indent: Length): Pf
- val argumentStarts: Map[TokenHash, Tree]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def binPackParentConstructorSplits(chain: Either[Template, Seq[With]], lastToken: Token, indentLen: Int)(implicit line: Line, style: ScalafmtConfig): Seq[Split]
- def canStartSelectChain(thisSelect: Select, nextSelect: Option[Select], lastApply: Tree)(implicit style: ScalafmtConfig): Boolean
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def couldUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
- def ctorWithChain(ownerSet: Set[Tree], lastToken: Token)(implicit style: ScalafmtConfig): Policy
- def decideNewlinesOnlyAfterClose(split: Split)(close: Token)(implicit line: Line): Policy
- def decideNewlinesOnlyAfterToken(token: Token)(implicit line: Line): Policy
- def decideNewlinesOnlyBeforeClose(split: Split)(close: Token)(implicit line: Line): Policy
- def decideNewlinesOnlyBeforeClose(close: Token)(implicit line: Line): Policy
- def defnSiteLastToken(close: FormatToken, tree: Tree): Token
- def delayedBreakPolicy(end: WithPos)(onBreakPolicy: Policy)(implicit line: Line): Policy
- def delayedBreakPolicyFactory(onBreakPolicy: Policy): Pf
- 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
- val filename: String
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findArgsFor[A <: Tree](token: Token, argss: Seq[Seq[A]]): Option[Seq[A]]
- final def findFirst(start: FormatToken, end: Int)(f: (FormatToken) => Boolean): Option[FormatToken]
- Annotations
- @tailrec()
- final def findFirst(start: FormatToken, end: Token)(f: (FormatToken) => Boolean): Option[FormatToken]
- final def findLastApplyAndNextSelect(tree: Tree, enclosed: Boolean): (Tree, Option[Select])
- final def findLeftInfix(app: InfixApp): InfixApp
- Annotations
- @tailrec()
- def findPrevSelect(tree: Select, enclosed: Boolean = true): Option[Select]
- final def findPrevSelect(tree: Tree, enclosed: Boolean): Option[Select]
- Annotations
- @tailrec()
- final def findToken(ft: FormatToken, iter: (FormatToken) => FormatToken)(f: (FormatToken) => Boolean): Either[FormatToken, FormatToken]
- final def findTokenWith[A](ft: FormatToken, iter: (FormatToken) => FormatToken)(f: (FormatToken) => Option[A]): Either[FormatToken, A]
- Annotations
- @tailrec()
- final def findXmlLastLineIndent(ft: FormatToken): Int
- Annotations
- @tailrec()
- val forceConfigStyle: Set[Tree]
- def functionExpire(function: Function): (Token, ExpiresOn)
- def getApplyArgs(ft: FormatToken, isRight: Boolean)(implicit style: ScalafmtConfig): (Tree, Seq[Tree])
- def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false)(implicit style: ScalafmtConfig): Num
- def getCaseArrow(term: Case): FormatToken
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getClosingIfEnclosedInMatching(tree: Tree): Option[Token]
- def getElseChain(term: If): Seq[Token]
- Annotations
- @inline()
- def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): TokenRanges
- def getForceConfigStyle: (Set[Tree], Set[TokenHash])
- def getFuncArrow(term: Function): Option[FormatToken]
- def getInfixSplitsBeforeLhs(lhsApp: InfixApp, ft: FormatToken, newStmtMod: Option[Modification] = None)(implicit style: ScalafmtConfig): Seq[Split]
- def getLambdaAtSingleArgCallSite(ft: FormatToken)(implicit style: ScalafmtConfig): Option[Function]
- def getMidInfixToken(app: InfixApp): Token
- def getNoSplit(ft: FormatToken, spaceOk: Boolean)(implicit style: ScalafmtConfig): Modification
- def getOptimalTokenFor(ft: FormatToken): Token
- def getOptimalTokenFor(token: Token): Token
- def getSingleLineInfixPolicy(end: Token): Policy
- def getSpaceAndNewlineAfterCurlyLambda(newlines: Int)(implicit style: ScalafmtConfig): (Boolean, NewlineT)
- def hasMatching(token: Token): Boolean
- Annotations
- @inline()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val importTokens: Set[Token]
- 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()
- val initStyle: ScalafmtConfig
- def insideBlock(start: FormatToken, end: Token, matches: (FormatToken) => Boolean): TokenRanges
- def insideBlock[A](start: FormatToken, end: Token)(implicit classifier: Classifier[Token, A]): TokenRanges
- def insideInfixSplit(app: InfixApp, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]
- def isBinPack(owner: Tree): Boolean
- def isCaseBodyEnclosedAsBlock(ft: FormatToken, caseStat: Case)(implicit style: ScalafmtConfig): Boolean
- def isEmptyFunctionBody(tree: Tree): Boolean
- def isEnclosedInMatching(tree: Tree): Boolean
- def isEnclosedInMatching(tree: Tree, open: Token, close: Token): Boolean
- final def isInfixRhs(ft: FormatToken): Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
- final def leadingComment(formatToken: FormatToken): FormatToken
- def matching(token: Token): Token
- Annotations
- @inline()
- def matchingOpt(token: Token): Option[Token]
- Annotations
- @inline()
- def mustUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def next(tok: FormatToken): FormatToken
- Annotations
- @inline()
- final def nextNonComment(curr: FormatToken): FormatToken
- final def nextNonCommentSameLine(curr: FormatToken): FormatToken
- 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(ft: => FormatToken, whenSourceIgnored: Boolean = false)(implicit style: ScalafmtConfig): Boolean
- def opensConfigStyleImplicitParamList(formatToken: FormatToken)(implicit style: ScalafmtConfig): Boolean
- def opensImplicitParamList(ft: FormatToken, args: Seq[Tree]): Boolean
- def opensImplicitParamList(ft: FormatToken): Option[Seq[Param]]
- val optionalNewlines: Set[TokenHash]
- def owners(token: Token): Tree
- Annotations
- @inline()
- val packageTokens: Set[Token]
- def parensTuple(token: Token): TokenRanges
- def penalizeNewlineByNesting(from: Token, to: Token)(implicit line: Line): Policy
- def prev(tok: FormatToken): FormatToken
- Annotations
- @inline()
- final def prevNonComment(curr: FormatToken): FormatToken
- final def prevNonCommentSameLine(curr: FormatToken): FormatToken
- final def rhsOptimalToken(start: FormatToken)(implicit style: ScalafmtConfig): Token
- val runner: ScalafmtRunner
- def splitOneArgOneLine(close: Token, owner: Tree)(implicit line: Line, style: ScalafmtConfig): Policy
- Annotations
- @inline()
- def splitOneArgPerLineAfterComma(owner: Tree)(implicit style: ScalafmtConfig): Pf
- def splitOneArgPerLineBeforeComma(owner: Tree)(implicit style: ScalafmtConfig): Pf
- final def startsNewBlockOnRight(ft: FormatToken): Boolean
- final def startsStatement(token: Token): Option[Tree]
- Annotations
- @inline()
- final def startsStatement(tok: FormatToken): Option[Tree]
- Annotations
- @inline()
- 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
- 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 withIndentOnXmlSpliceStart(ft: FormatToken, splits: Seq[Split])(implicit style: ScalafmtConfig): Seq[Split]
- def withIndentOnXmlStart(tok: Start, splits: Seq[Split])(implicit style: ScalafmtConfig): Seq[Split]
- def xmlSpace(owner: Tree): Modification
- object :owner:
- object CtrlBodySplits