Object

org.scalafmt.util

TokenOps

Related Doc: package util

Permalink

object TokenOps

Stateless helper functions on scala.meta.Token.

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

Type Members

  1. type TokenHash = Long

    Permalink

    For convenience when experimenting with different hashing strategies.

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. def SingleLineBlock(expire: Token, exclude: Set[Range] = Set.empty, disallowInlineComments: Boolean = true)(implicit line: Line): Policy

    Permalink

    Forces allssplits up to including expire to be on a single line.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val booleanOperators: Set[String]

    Permalink
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def defnTemplate(tree: Tree): Option[Template]

    Permalink
  9. def endsWithNoIndent(between: Vector[Whitespace]): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. val formatOffCode: Set[String]

    Permalink
  14. val formatOnCode: Set[String]

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hash(token: Token): TokenHash

    Permalink

    Custom hash code for token.

    Custom hash code for token.

    The default hashCode is slow because it prevents conflicts between tokens from different source files. We only care about getting a unique identifier for the token inside this source file.

    The hash code works like this this: Top 8 bits go to privateTag, a unique identifier for the tokens class. Next 28 bits go to the tokens **start** offset byte. Final 28 bits go to the tokens **end** offset byte.

    The only chance for collision is if two empty length tokens with the same type lie next to each other. @xeno-by said this should not happen.

    Annotations
    @inline()
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. def identModification(ident: Ident): Modification

    Permalink
  19. def isAssignmentOperator(token: Token): Boolean

    Permalink
  20. def isAttachedComment(token: Token, between: Vector[Whitespace]): Boolean

    Permalink
  21. def isBoolOperator(token: Token): Boolean

    Permalink
  22. def isDocstring(token: Token): Boolean

    Permalink
  23. def isFormatOff(token: Token): Boolean

    Permalink
  24. def isFormatOn(token: Token): Boolean

    Permalink
  25. def isInlineComment(token: Token): Boolean

    Permalink
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. def isOpenApply(token: Token, includeCurly: Boolean = false): Boolean

    Permalink
  28. def isSingleIdentifierAnnotation(tok: FormatToken): Boolean

    Permalink
  29. def lastToken(tree: Tree): Token

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

    Permalink
    Definition Classes
    AnyRef
  31. def newlineOkOperator(token: Token): Boolean

    Permalink
  32. val newlineOkOperators: Set[String]

    Permalink
  33. def newlines2Modification(between: Vector[Whitespace]): Modification

    Permalink
  34. def newlinesBetween(between: Vector[Whitespace]): Int

    Permalink
  35. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  37. def rhsIsCommentedOut(formatToken: FormatToken): Boolean

    Permalink
  38. def shouldGet2xNewlines(tok: FormatToken): Boolean

    Permalink
  39. val specialAssignmentOperators: Set[String]

    Permalink
  40. val symbolOperatorPrecendence: PartialFunction[Char, Int]

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  43. def tokenLength(token: Token): Int

    Permalink
  44. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped