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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def blankLineBeforeDocstring(ft: FormatToken)(implicit style: ScalafmtConfig): Boolean
  6. val booleanOperators: Set[String]
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def defnBeforeTemplate(tree: Tree): Option[Tree]
  9. def defnTemplate(tree: Tree): Option[Template]
  10. def endsWithNoIndent(between: Seq[Token]): Boolean
  11. def endsWithSymbolIdent(tok: Token): Boolean
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. def findArgsFor[A <: Tree](token: Token, argss: Seq[Seq[A]], matchingOpt: (Token) => Option[Token]): Option[Seq[A]]
  16. def findLast[A](seq: Seq[A])(cond: (A) => Boolean): Option[A]
  17. def findLastNonTrivialToken(tokens: Tokens): Token
  18. def findLastNonTrivialTokenOpt(tokens: Tokens): Option[Token]
  19. def findLastVisibleToken(tokens: Tokens): Token
  20. def findLastVisibleTokenOpt(tokens: Tokens): Option[Token]
  21. val formatOffCode: Set[String]
  22. val formatOnCode: Set[String]
  23. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. def getMod(ft: FormatToken, noIndent: Boolean = false): Modification
  25. def getModCheckIndent(ft: FormatToken, newlines: Int): Modification
  26. def getModCheckIndent(ft: FormatToken): Modification
  27. def getXmlLastLineIndent(tok: Part): Option[Int]
  28. 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()
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. def identModification(ident: Ident): Modification
  31. def isAttachedSingleLineComment(ft: FormatToken): Boolean
  32. def isBoolOperator(token: Token): Boolean
  33. def isDocstring(text: String): Boolean
  34. def isFormatOff(token: Token): Boolean
    Annotations
    @inline()
  35. def isFormatOn(token: Token): Boolean
    Annotations
    @inline()
  36. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  37. def isSingleLineComment(token: Token): Boolean
  38. def isSingleLineComment(c: Comment): Boolean
    Annotations
    @inline()
  39. def isSingleLineComment(c: String): Boolean
    Annotations
    @inline()
  40. def isSymbolicIdent(tok: Token): Boolean
  41. def isSymbolicName(name: String): Boolean
  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  44. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  45. def rhsIsCommentedOut(formatToken: FormatToken): Boolean
  46. def shouldBreak(ft: FormatToken)(implicit style: ScalafmtConfig): Boolean
  47. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  48. def toString(): String
    Definition Classes
    AnyRef → Any
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped