Package

org

scalafmt

Permalink

package scalafmt

Visibility
  1. Public
  2. All

Type Members

  1. case class AlignToken(code: String, owner: String) extends Product with Serializable

    Permalink

    Configuration option for aligning tokens.

    Configuration option for aligning tokens.

    code

    string literal value of the token to align by.

    owner

    regexp for class name of scala.meta.Tree "owner" of code.

  2. sealed abstract class Error extends Exception

    Permalink
  3. abstract class FormatEvent extends AnyRef

    Permalink

    An event that happens while formatting a file.

  4. sealed abstract class FormatResult extends AnyRef

    Permalink
  5. case class ScalafmtOptimizer(dequeueOnNewStatements: Boolean, escapeInPathologicalCases: Boolean, MaxVisitsPerToken: Int, MaxEscapes: Int, MaxDepth: Int, acceptOptimalAtHints: Boolean, disableOptimizationsInsideSensitiveAreas: Boolean, pruneSlowStates: Boolean, recurseOnBlocks: Boolean) extends Product with Serializable

    Permalink

    Configuration for scalafmt optimizations.

    Configuration for scalafmt optimizations.

    dequeueOnNewStatements

    Clear the search queue on new statements.

    escapeInPathologicalCases

    Use heuristics to escape when the search state grows out of bounds. An optimization that trades off optimal formatting output in order to complete in a reasonable time. Used as a last resort.

    MaxVisitsPerToken

    Visit the same formatToken at most MaxVisitsPerToken times.

    MaxEscapes

    How often do we try to escape before giving up and use original formatting.

    MaxDepth

    Maximum depth of recursion.

    acceptOptimalAtHints

    Whether to listen to optimalAt fields in Splits.

    disableOptimizationsInsideSensitiveAreas

    Do not optimize inside certain areas such as term apply.

    pruneSlowStates

    Eliminate solutions that move slower than other solutions. If a solution reaches a point X first and other solution that reaches the same point later, the first solution is preferred if it can be verified to be always better (see org.scalafmt.internal.State.alwaysBetter()). Note. This affects the output positively because it breaks a tie between two equally expensive solutions by eliminating the slower one. Example, solution 1 is preferred even though both solutions cost the same: // solution 1 a + b + c + d // solution 2 a + b + c + d

    recurseOnBlocks

    Recursively format { ... } blocks inside no optimization zones. By starting a new search queue, we can perform aggressive optimizations inside optimizations zones.

  6. case class ScalafmtRunner(debug: Boolean, eventCallback: (FormatEvent) ⇒ Unit, parser: Parse[_ <: Tree], optimizer: ScalafmtOptimizer, maxStateVisits: Int) extends Product with Serializable

    Permalink

    A FormatRunner configures how formatting should behave.

    A FormatRunner configures how formatting should behave.

    debug

    Should we collect debugging statistics?

    eventCallback

    Listen to events that happens while formatting

    parser

    Are we formatting a scala.meta.{Source,Stat,Case,...}? For more details, see members of scala.meta.parsers.

  7. case class ScalafmtStyle(maxColumn: Int, scalaDocs: Boolean, alignStripMarginStrings: Boolean, binPackArguments: Boolean, binPackParameters: Boolean, configStyleArguments: Boolean, binPackDotChains: Boolean, noNewlinesBeforeJsNative: Boolean, continuationIndentCallSite: Int, continuationIndentDefnSite: Int, alignTokens: Set[AlignToken], spacesInImportCurlyBrackets: Boolean, allowNewlineBeforeColonInMassiveReturnTypes: Boolean, binPackParentConstructors: Boolean, alignByArrowEnumeratorGenerator: Boolean, alignByIfWhileOpenParen: Boolean) extends Product with Serializable

    Permalink

    Configuration options for scalafmt.

    Configuration options for scalafmt.

    maxColumn

    Column limit, any formatting exceeding this field is penalized heavily.

    scalaDocs

    Use scaladoc style docstring, otherwise use javadoc style.

    alignStripMarginStrings

    If true, the margin character | is treated as the new indentation in multiline strings ending with .stripMargin.

    binPackArguments

    If true, will fit as many arguments on each line, only breaking at commas. If false, a function call's arguments will either be all on the same line or will have one line each.

    binPackParameters

    Same as binPackArguments, except for def/class definition parameters.

    configStyleArguments

    Call-sites where there is a newline after opening ( and newline before closing ). If true, preserves the newlines and keeps one line per argument.

    binPackDotChains

    If true, will fit as many arguments on each line, only breaking at dots. If false, a either all selects go on the same line or will have one line each.

    noNewlinesBeforeJsNative

    If true, a newline will never be placed in front of js.native.

    continuationIndentCallSite

    Indent width for line continuation at call site.

    continuationIndentDefnSite

    Indent width for line continuation at definition/declaration site.

    allowNewlineBeforeColonInMassiveReturnTypes

    If true, scalafmt may choose to put a newline before colon : at defs.

    binPackParentConstructors

    Parent constructors are C and D in "class A extends B with C and D". If true, scalafmt will fit as many parent constructors on a single line. If false, each parent constructor gets its own line.

    alignByArrowEnumeratorGenerator

    If true, aligns by <- in for comprehensions.

    alignByIfWhileOpenParen

    If true, aligns by ( in if/while/for. If false, indents by continuationIndentCallSite.

Value Members

  1. object AlignToken extends Serializable

    Permalink
  2. object Error extends Serializable

    Permalink
  3. object FormatEvent

    Permalink
  4. object FormatResult

    Permalink
  5. object Scalafmt

    Permalink
  6. object ScalafmtOptimizer extends Serializable

    Permalink
  7. object ScalafmtRunner extends Serializable

    Permalink
  8. object ScalafmtStyle extends Serializable

    Permalink
  9. object Versions

    Permalink

    Single source of truth for version number.

  10. package internal

    Permalink
  11. package util

    Permalink

Ungrouped