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(open: Token, noTrailingCommas: Boolean = false)(implicit line: Line): Policy
- def UnindentAtExclude(exclude: Set[Token], indent: Length): PartialFunction[Decision, Decision]
- 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(owners: Set[Tree], lastToken: Token): Policy
- def defnSiteLastToken(open: Token, tree: Tree): Token
- val dequeueSpots: Set[TokenHash]
- implicit val dialect: Dialect
- def distance(left: Token, right: Token): Int
- val emptyQueueSpots: Set[TokenHash]
- 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])
- 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 getApplyIndent(leftOwner: Tree, isConfigStyle: Boolean = false): Num
- def getArrow(caseStat: Case): Token
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def getElseChain(term: If): Vector[KwElse]
- def getExcludeIf(end: Token, cond: (Token) => Boolean = _.is[T.RightBrace]): Set[Range]
- def getForceConfigStyle: (Set[Tree], Set[TokenHash])
- def getRightAttachedComment(token: Token): Token
- def getSelectsLastToken(dot: Dot): Token
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 hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val importTokens: Set[Token]
- def infixSplit(owner: Tree, op: Name, rhsArgs: Seq[Tree], formatToken: FormatToken)(implicit line: Line): Split
- def infixSplit(owner: ApplyInfix, formatToken: FormatToken)(implicit line: Line): 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
- def lastTokenInChain(chain: Vector[Select]): Token
- final def leadingComment(formatToken: FormatToken): Token
- Annotations
- @tailrec()
- lazy val leftTok2tok: Map[Token, FormatToken]
- def matching(token: Token): Token
- Annotations
- @inline()
- val matchingParentheses: Map[TokenHash, Token]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newlineBeforeClosingCurlyPolicy(close: Token): Policy
- def next(tok: FormatToken): FormatToken
- def next(tok: Token): Token
- def nextNonComment(curr: FormatToken): FormatToken
- 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 ownersMap: Map[TokenHash, Tree]
- 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
- def prev(tok: Token): Token
- def prevNonComment(curr: FormatToken): FormatToken
- final def prevNonCommentWithCount(curr: FormatToken, accum: Int = 0): (Int, FormatToken)
- Annotations
- @tailrec()
- final def rhsOptimalToken(start: FormatToken): Token
- Annotations
- @tailrec()
- val runner: ScalafmtRunner
- def safeFilterNewlines(splits: Seq[Split])(implicit line: Line): Seq[Split]
- def selectExpire(dot: Dot): Token
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.
- def skipUnindent(token: Token): Boolean
- 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
- lazy val tok2idx: Map[FormatToken, Int]
- val tokens: Array[FormatToken]
- 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: