Class/Object

org.scalafmt.config

ScalafmtOptimizer

Related Docs: object ScalafmtOptimizer | package config

Permalink

case class ScalafmtOptimizer(dequeueOnNewStatements: Boolean = true, escapeInPathologicalCases: Boolean = true, maxVisitsPerToken: Int = 513, maxEscapes: Int = 16, maxDepth: Int = 100, acceptOptimalAtHints: Boolean = true, disableOptimizationsInsideSensitiveAreas: Boolean = true, pruneSlowStates: Boolean = true, recurseOnBlocks: Boolean = true, forceConfigStyleOnOffset: Int = 150, forceConfigStyleMinArgCount: Int = 2) extends Product with Serializable

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.

forceConfigStyleOnOffset

If negative number, does nothing. If n >= 0, then scalafmt will force "config style" on Term.Apply nodes IF it has more than forceConfigStyleMinArgCount arguments AND the non-whitespace byte offset between the opening parens and closing parens is greater than forceConfigStyleOnOffset. By forcing config style on such applications, the search space is greatly reduced.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScalafmtOptimizer
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScalafmtOptimizer(dequeueOnNewStatements: Boolean = true, escapeInPathologicalCases: Boolean = true, maxVisitsPerToken: Int = 513, maxEscapes: Int = 16, maxDepth: Int = 100, acceptOptimalAtHints: Boolean = true, disableOptimizationsInsideSensitiveAreas: Boolean = true, pruneSlowStates: Boolean = true, recurseOnBlocks: Boolean = true, forceConfigStyleOnOffset: Int = 150, forceConfigStyleMinArgCount: Int = 2)

    Permalink

    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.

    forceConfigStyleOnOffset

    If negative number, does nothing. If n >= 0, then scalafmt will force "config style" on Term.Apply nodes IF it has more than forceConfigStyleMinArgCount arguments AND the non-whitespace byte offset between the opening parens and closing parens is greater than forceConfigStyleOnOffset. By forcing config style on such applications, the search space is greatly reduced.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val acceptOptimalAtHints: Boolean

    Permalink

    Whether to listen to optimalAt fields in Splits.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val dequeueOnNewStatements: Boolean

    Permalink

    Clear the search queue on new statements.

  8. val disableOptimizationsInsideSensitiveAreas: Boolean

    Permalink

    Do not optimize inside certain areas such as term apply.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. val escapeInPathologicalCases: Boolean

    Permalink

    Use heuristics to escape when the search state grows out of bounds.

    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.

  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. val forceConfigStyleMinArgCount: Int

    Permalink
  13. val forceConfigStyleOnOffset: Int

    Permalink

    If negative number, does nothing.

    If negative number, does nothing. If n >= 0, then scalafmt will force "config style" on Term.Apply nodes IF it has more than forceConfigStyleMinArgCount arguments AND the non-whitespace byte offset between the opening parens and closing parens is greater than forceConfigStyleOnOffset. By forcing config style on such applications, the search space is greatly reduced.

  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. val maxDepth: Int

    Permalink

    Maximum depth of recursion.

  17. val maxEscapes: Int

    Permalink

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

  18. val maxVisitsPerToken: Int

    Permalink

    Visit the same formatToken at most maxVisitsPerToken times.

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. val pruneSlowStates: Boolean

    Permalink

    Eliminate solutions that move slower than other solutions.

    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

  23. val reader: ConfDecoder[ScalafmtOptimizer]

    Permalink
  24. val recurseOnBlocks: Boolean

    Permalink

    Recursively format { ...

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

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped