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(topSourceTree: Tree, baseStyle: ScalafmtConfig, filename: String = "")
Type Members
- class ExtractFromMeta[A] extends AnyRef
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
- val ExtractAndOrTypeRhsIdentLeft: ExtractFromMeta[Type]
- val LambdaAtSingleArgCallSite: ExtractFromMeta[FunctionTerm]
- val StartsStatementRight: ExtractFromMeta[Tree]
- def UnindentAtExclude(exclude: Set[Token], indent: Length): Pf
- val argumentStarts: Map[TokenHash, Tree]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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]
- def canStartSelectChain(thisSelectLike: SelectLike, nextSelect: Option[Term], 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 fileLine: FileLine): Policy
- def decideNewlinesOnlyAfterClose(close: Token)(implicit fileLine: FileLine): Policy
- def decideNewlinesOnlyAfterToken(token: Token)(implicit fileLine: FileLine): Policy
- def decideNewlinesOnlyBeforeClose(split: Split)(close: Token)(implicit fileLine: FileLine): Policy
- def decideNewlinesOnlyBeforeClose(close: Token)(implicit fileLine: FileLine): Policy
- def decideNewlinesOnlyBeforeCloseOnBreak(close: Token)(implicit fileLine: FileLine): Policy
- def defnSiteLastToken(close: FormatToken, tree: Tree): Token
- 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 existsBlockIfWithoutElse(tree: Tree): Boolean
- def existsBlockIfWithoutElse(t: If): Boolean
- 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]
- Annotations
- @inline()
- def findFirstOnRight[A](start: FormatToken, end: Token)(implicit classifier: Classifier[Token, A]): Option[Token]
- final def findLastApplyAndNextSelect(tree: Tree, enclosed: Boolean): (Tree, Option[SelectLike])
- final def findLeftInfix(app: InfixApp): InfixApp
- Annotations
- @tailrec()
- def findPrevSelect(tree: SelectLike, enclosed: Boolean = true): Option[SelectLike]
- final def findPrevSelect(tree: Tree, enclosed: Boolean): Option[SelectLike]
- Annotations
- @tailrec()
- def findTemplateGroupOnRight[A](func: (TemplateSupertypeGroup) => A)(template: Template)(implicit ft: FormatToken): Option[A]
- final def findXmlLastLineIndent(ft: FormatToken): Int
- Annotations
- @tailrec()
- val forceConfigStyle: Set[Tree]
- def functionExpire(function: FunctionTerm): (Token, ExpiresOn)
- def getApplyArgs(ft: FormatToken, isRight: Boolean)(implicit style: ScalafmtConfig): TreeArgs
- def getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false)(implicit style: ScalafmtConfig): Num
- def getCaseArrow(term: TypeCase): FormatToken
- 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 getEndOfBlock(ft: FormatToken, parensToo: Boolean)(implicit style: ScalafmtConfig): Option[Token]
- def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): TokenRanges
- def getForceConfigStyle: (Set[Tree], Set[TokenHash])
- def getFuncArrow(term: FunctionTerm): Option[FormatToken]
- def getInfixSplitsBeforeLhs(lhsApp: InfixApp, ft: FormatToken, newStmtMod: Option[Modification] = None)(implicit style: ScalafmtConfig): Seq[Split]
- def getKwMatchAfterDot(ft: FormatToken): KwMatch
- def getLambdaAtSingleArgCallSite(ft: FormatToken): Option[FunctionTerm]
- def getLastNonTrivialToken(tree: Tree): Token
- def getLastNonTrivialTokenOpt(tree: Tree): Option[Token]
- def getLastToken(tree: Tree): Token
- def getLastTokenOpt(tree: Tree): Option[Token]
- def getMatchDot(tree: Match): Option[FormatToken]
- 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 getSplitsForTypeBounds(ft: FormatToken, noNLMod: => Modification, typeOwner: Tree, boundEndOpt: Option[Token])(implicit style: ScalafmtConfig): Seq[Split]
- def getSplitsForTypeBounds(ft: FormatToken, noNLMod: => Modification, tparam: Param, bounds: (Param) => Seq[Type])(implicit style: ScalafmtConfig): Seq[Split]
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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()
- def insideBlock(matches: (FormatToken) => Option[Token])(start: FormatToken, end: Token): TokenRanges
- def insideBlock(start: FormatToken, end: Token, matches: (FormatToken) => Boolean): TokenRanges
- def insideBlock[A](start: FormatToken, end: Token)(implicit classifier: Classifier[Token, A]): TokenRanges
- def insideBracesBlock(start: FormatToken, end: Token, parensToo: Boolean = false)(implicit style: ScalafmtConfig): TokenRanges
- def insideInfixSplit(app: InfixApp, ft: FormatToken)(implicit style: ScalafmtConfig): Seq[Split]
- def isBlockWithoutOptionalBraces(t: Block): Boolean
- def isCaseBodyEnclosedAsBlock(ft: FormatToken, caseStat: CaseTree)(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 isRightImplicitOrUsingSoftKw(ft: FormatToken, soft: SoftKeywordClasses): Boolean
- def isSingleIdentifierAnnotation(tok: FormatToken): Boolean
- final def leadingComment(tree: Tree): FormatToken
- Annotations
- @inline()
- final def leadingComment(ft: FormatToken): FormatToken
- Annotations
- @inline()
- def mustUseConfigStyle(ft: FormatToken, allowForce: => Boolean = true)(implicit style: ScalafmtConfig): Boolean
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noOptimizationZones(): 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
Works for
usingas well - def opensImplicitParamList(ft: FormatToken, args: Seq[Tree]): Boolean
Works for
usingas well - def opensImplicitParamList(ft: FormatToken): Option[Seq[Param]]
- val optionalNewlines: Set[TokenHash]
- def owners(token: Token): Tree
- Annotations
- @inline()
- def parensTuple(token: Token): TokenRanges
- def penalizeNewlineByNesting(from: Token, to: Token)(implicit fileLine: FileLine): Policy
- final def rhsOptimalToken(start: FormatToken)(implicit style: ScalafmtConfig): Token
- val runner: ScalafmtRunner
- def splitOneArgOneLine(close: Token, owner: Tree)(implicit fileLine: FileLine, style: ScalafmtConfig): Policy
- Annotations
- @inline()
- def splitOneArgPerLineAfterComma(owner: Tree): Pf
- def splitOneArgPerLineAfterCommaOnBreak(comma: Token): Policy
- def splitOneArgPerLineBeforeComma(owner: Tree): 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()
- val styleMap: StyleMap
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def templateCurly(template: Template): Option[Token]
- def templateCurlyFt(template: Template): Option[FormatToken]
- def templateCurlyOrLastNonTrivial(template: Template): Token
- def templateDerivesOrCurlyOrLastNonTrivial(template: Template)(implicit ft: FormatToken): Token
- def toString(): String
- Definition Classes
- AnyRef → Any
- val tokens: FormatTokens
- val topSourceTree: Tree
- final def trailingComment(ft: FormatToken, end: Int): FormatToken
- Annotations
- @inline()
- def typeTemplateSplits(template: Template, indentIfSecond: Int)(implicit fileLine: FileLine, ft: FormatToken, style: ScalafmtConfig): Seq[Split]
- 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 CtrlBodySplits
- object GetSelectLike
- object OptionalBraces