Class/Object

org.scalafmt.internal

BestFirstSearch

Related Docs: object BestFirstSearch | package internal

Permalink

class BestFirstSearch extends ScalaFmtLogger

Implements best first search to find optimal formatting.

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

Instance Constructors

  1. new BestFirstSearch(style: ScalaStyle, tree: Tree, range: Set[Range])

    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. final def asInstanceOf[T0]: T0

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

    Permalink
  6. def cleanup(token: Token): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  7. def clone(): AnyRef

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

    Permalink
  9. val dequeOnNewStatements: Boolean

    Permalink

    When entering a new statement, clear out search queue.

  10. val disableOptimizationsInsideSensitiveAreas: Boolean

    Permalink

    Do not optimize inside certain areas such as term apply.

  11. val doOptimizations: Boolean

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def escape(raw: String): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  15. var explored: Int

    Permalink
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def formatTree(): String

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

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

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

    Permalink
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. def header[T](t: T): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  23. def isInsideNoOptZone(token: FormatToken): Boolean

    Permalink
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def log(t: Tree, tokensOnly: Boolean = false): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  26. def log(token: Token): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  27. def log(tokens: Tokens): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  28. def log(tokens: Token*): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  29. def log(formatToken: FormatToken): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  30. def log(split: Split): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  31. val logger: PrintlnLogger.type

    Permalink
    Definition Classes
    ScalaFmtLogger
  32. val matchingParentheses: Map[TokenHash, Token]

    Permalink
  33. val maxQueueSize: Int

    Permalink

    Dequeue on new statements if queue exceeds this size,

    Dequeue on new statements if queue exceeds this size,

    Overrides dequeOnNewStatements, appears necessary in cases like JavaLangObject.scala in Scala.js.

    TODO(olafur) come up with less hacky solution.

  34. val maxVisitStates: Int

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

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

    Permalink
    Definition Classes
    AnyRef
  37. def noOptimizationZones(tree: Tree): Set[Token]

    Permalink
  38. val noOptimizations: Set[Token]

    Permalink
  39. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  41. val owners: Map[TokenHash, Tree]

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

    Permalink
  43. val pruneNonOptimal: Boolean

    Permalink

    Eliminate solutions that are inferior to already explored solutions.

    Eliminate solutions that are inferior to already explored solutions.

    If a solution is reaches a point at cost X then any other solution that reaches the same token with a cost > X will be eliminated.

    TODO(olafur) benchmark this optimization, I think it doesn't give much.

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

  45. def reveal(s: String): String

    Permalink
    Definition Classes
    ScalaFmtLogger
  46. val router: Router

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

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

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

    Permalink

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

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

    Permalink
  51. def stateColumnKey(state: State): Int

    Permalink
  52. var statementCount: Int

    Permalink
  53. val statementStarts: Map[TokenHash, Tree]

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  56. val toks: Array[FormatToken]

    Permalink
  57. final def wait(): Unit

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

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

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

Inherited from ScalaFmtLogger

Inherited from AnyRef

Inherited from Any

Ungrouped