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

Type Members

  1. type TokenHash = Long

    For convenience when experimenting with different hashing strategies.

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

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

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val booleanOperators: Set[String]
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def defnTemplate(tree: Tree): Option[Template]
  9. def endsWithNoIndent(between: Seq[Token]): Boolean
  10. def endsWithSymbolIdent(tok: Token): Boolean
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. def forceDocstringBlankLine(token: Token, style: ScalafmtConfig): Boolean
  15. val formatOffCode: Set[String]
  16. val formatOnCode: Set[String]
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def hash(token: Token): TokenHash

    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 a hashCode of productPrefix, 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()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def identModification(ident: Ident): Modification
  21. def isAssignmentOperator(token: Token): Boolean
  22. def isAttachedSingleLineComment(ft: FormatToken): Boolean
  23. def isBoolOperator(token: Token): Boolean
  24. def isFormatOff(token: Token): Boolean
  25. def isFormatOn(token: Token): Boolean
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def isNoIndent(formatToken: FormatToken): Boolean
  28. def isOpenApply(token: Token, includeCurly: Boolean = false, includeNoParens: Boolean = false): Boolean
  29. def isRightAssociativeOperator(op: String): Boolean
  30. def isSingleLineComment(token: Token): Boolean
  31. def isSingleLineComment(c: Comment): Boolean
  32. def isSymbolicIdent(tok: Token): Boolean
  33. def isSymbolicName(name: String): Boolean
  34. def lastToken(tree: Tree): Token
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. def newlineOkOperator(token: Token): Boolean
  37. val newlineOkOperators: Set[String]
  38. def newlines2Modification(newlines: Int, noIndent: Boolean = false): Modification
  39. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. def rhsIsCommentedOut(formatToken: FormatToken): Boolean
  42. def shouldGet2xNewlines(tok: FormatToken)(implicit style: ScalafmtConfig): Boolean
  43. val specialAssignmentOperators: Set[String]
  44. val symbolOperatorPrecendence: PartialFunction[Char, Int]
  45. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. def tokenLength(token: Token): Int
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped