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, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScalafmtOptimizer
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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)

    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
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val acceptOptimalAtHints: Boolean
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. val dequeueOnNewStatements: Boolean
  8. val disableOptimizationsInsideSensitiveAreas: Boolean
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. val escapeInPathologicalCases: Boolean
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. val forceConfigStyleMinArgCount: Int
  13. val forceConfigStyleOnOffset: Int
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. val maxDepth: Int
  17. val maxEscapes: Int
  18. val maxVisitsPerToken: Int
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. val pruneSlowStates: Boolean
  24. val reader: ConfDecoder[ScalafmtOptimizer]
  25. val recurseOnBlocks: Boolean
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped