case class ScalafmtOptimizer(dequeueOnNewStatements: Boolean = true, escapeInPathologicalCases: Boolean = true, maxVisitsPerToken: Int = 10000, 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.
- Alphabetic
- By Inheritance
- ScalafmtOptimizer
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ScalafmtOptimizer(dequeueOnNewStatements: Boolean = true, escapeInPathologicalCases: Boolean = true, maxVisitsPerToken: Int = 10000, 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
- 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 acceptOptimalAtHints: Boolean
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val dequeueOnNewStatements: Boolean
- val disableOptimizationsInsideSensitiveAreas: Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val escapeInPathologicalCases: Boolean
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val forceConfigStyleMinArgCount: Int
- val forceConfigStyleOnOffset: Int
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val maxDepth: Int
- val maxEscapes: Int
- val maxVisitsPerToken: Int
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val pruneSlowStates: Boolean
- val reader: ConfDecoder[ScalafmtOptimizer]
- val recurseOnBlocks: Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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()