Class

org.scalafmt.internal

BestFirstSearch

Related Doc: package internal

Permalink

class BestFirstSearch extends AnyRef

Implements best first search to find optimal formatting.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BestFirstSearch
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BestFirstSearch(formatOps: FormatOps, range: Set[Range], formatWriter: FormatWriter)

    Permalink

Type Members

  1. type StateHash = Long

    Permalink

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 MaxDepth: Int

    Permalink
  5. val MaxEscapes: Int

    Permalink
  6. val MaxVisitsPerToken: Int

    Permalink

    Visit the same formatToken at most MaxVisitsPerToken times.

    Visit the same formatToken at most MaxVisitsPerToken times.

    If the same token is

  7. val acceptOptimalAtHints: Boolean

    Permalink

    Whether to listen to optimalAt fields in Splits.

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. val best: Map[Token, State]

    Permalink
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. var deepestYet: State

    Permalink
  12. var deepestYetSafe: State

    Permalink
  13. val dequeueOnNewStatements: Boolean

    Permalink

    When entering a new statement, clear out search queue.

  14. val disableOptimizationsInsideSensitiveAreas: Boolean

    Permalink

    Do not optimize inside certain areas such as term apply.

  15. val doOptimizations: Boolean

    Permalink
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. 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.

  19. var explored: Int

    Permalink
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. val formatOps: FormatOps

    Permalink
  22. def getBestPath: Vector[Split]

    Permalink
  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. def getLeftLeft(curr: State): Token

    Permalink
  25. def hasReachedEof(state: State): Boolean

    Permalink
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. def isInsideNoOptZone(token: FormatToken): Boolean

    Permalink
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. val maxVisitStates: Int

    Permalink
  30. val memo: Map[(Int, StateHash), State]

    Permalink
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. val noOptimizations: Set[Token]

    Permalink
  33. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  35. var pathologicalEscapes: Int

    Permalink
  36. def provided(formatToken: FormatToken): Split

    Permalink
  37. 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 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

  38. 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.

  39. val router: Router

    Permalink
  40. def shortestPath(start: State, stop: Token, depth: Int = 0, maxCost: Int = Integer.MAX_VALUE)(implicit line: Line): State

    Permalink

    Runs best first search to find lowest penalty split.

  41. def shortestPathMemo(start: State, stop: Token, depth: Int, maxCost: Int)(implicit line: Line): State

    Permalink
  42. def shouldEnterState(curr: State): Boolean

    Permalink

    Returns true if it's OK to skip over state.

  43. def shouldRecurseOnBlock(curr: State, stop: Token): Boolean

    Permalink
  44. def stateColumnKey(state: State): StateHash

    Permalink
  45. var statementCount: Int

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

    Permalink
    Definition Classes
    AnyRef
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. def untilNextStatement(state: State): State

    Permalink
  49. val visits: Map[FormatToken, Int]

    Permalink
  50. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped