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

    Permalink
    Definition Classes
    Any
  5. def blankLineBeforeDocstring(ft: FormatToken)(implicit style: ScalafmtConfig): Boolean

    Permalink
  6. val booleanOperators: Set[String]

    Permalink
  7. def classifyOnRight[A](cls: Classifier[Token, A])(ft: FormatToken): Boolean

    Permalink
  8. def clone(): AnyRef

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

    Permalink
  10. def defnTemplate(tree: Tree): Option[Template]

    Permalink
  11. def endsWithNoIndent(between: Seq[Token]): Boolean

    Permalink
  12. def endsWithSymbolIdent(tok: Token): Boolean

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def findArgsFor[A <: Tree](token: Token, argss: Seq[Seq[A]], matching: Map[TokenHash, Token]): Option[Seq[A]]

    Permalink
  17. def findLast[A](seq: Seq[A])(cond: (A) ⇒ Boolean): Option[A]

    Permalink
  18. val formatOffCode: Set[String]

    Permalink
  19. val formatOnCode: Set[String]

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getMod(ft: FormatToken, noIndent: Boolean = false): Modification

    Permalink
  22. def getModCheckIndent(ft: FormatToken, newlines: Int): Modification

    Permalink
  23. def getModCheckIndent(ft: FormatToken): Modification

    Permalink
  24. def getXmlLastLineIndent(tok: Part): Option[Int]

    Permalink
  25. 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 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()
  26. def hashCode(): Int

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

    Permalink
  28. def isAttachedSingleLineComment(ft: FormatToken): Boolean

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

    Permalink
  30. def isDocstring(text: String): Boolean

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

    Permalink
    Annotations
    @inline()
  32. def isFormatOn(token: Token): Boolean

    Permalink
    Annotations
    @inline()
  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. def isSingleLineComment(token: Token): Boolean

    Permalink
  35. def isSingleLineComment(c: Comment): Boolean

    Permalink
    Annotations
    @inline()
  36. def isSingleLineComment(c: String): Boolean

    Permalink
    Annotations
    @inline()
  37. def isSymbolicIdent(tok: Token): Boolean

    Permalink
  38. def isSymbolicName(name: String): Boolean

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

    Permalink
  40. def lastToken(tokens: Tokens): Token

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

    Permalink
    Definition Classes
    AnyRef
  42. final def notify(): Unit

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

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

    Permalink
  45. def shouldBreak(ft: FormatToken)(implicit style: ScalafmtConfig): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  48. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped