object TokenOps
Stateless helper functions on scala.meta.Token.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- TokenOps
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- type TokenHash = Long
For convenience when experimenting with different hashing strategies.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def blankLineBeforeDocstring(ft: FormatToken)(implicit style: ScalafmtConfig): Boolean
- val booleanOperators: Set[String]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def defnBeforeTemplate(tree: Tree): Option[Tree]
- def defnTemplate(tree: Tree): Option[Template]
- def endsWithNoIndent(between: Seq[Token]): Boolean
- def endsWithSymbolIdent(tok: Token): Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findArgsFor[A <: Tree](token: Token, argss: Seq[Seq[A]], matchingOpt: (Token) => Option[Token]): Option[Seq[A]]
- def findLast[A](seq: Seq[A])(cond: (A) => Boolean): Option[A]
- def findLastNonTrivialToken(tokens: Tokens): Token
- def findLastNonTrivialTokenOpt(tokens: Tokens): Option[Token]
- def findLastVisibleToken(tokens: Tokens): Token
- def findLastVisibleTokenOpt(tokens: Tokens): Option[Token]
- val formatOffCode: Set[String]
- val formatOnCode: Set[String]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getMod(ft: FormatToken, noIndent: Boolean = false): Modification
- def getModCheckIndent(ft: FormatToken, newlines: Int): Modification
- def getModCheckIndent(ft: FormatToken): Modification
- def getXmlLastLineIndent(tok: Part): Option[Int]
- 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()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def identModification(ident: Ident): Modification
- def isAttachedSingleLineComment(ft: FormatToken): Boolean
- def isBoolOperator(token: Token): Boolean
- def isDocstring(text: String): Boolean
- def isFormatOff(token: Token): Boolean
- Annotations
- @inline()
- def isFormatOn(token: Token): Boolean
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isSingleLineComment(token: Token): Boolean
- def isSingleLineComment(c: Comment): Boolean
- Annotations
- @inline()
- def isSingleLineComment(c: String): Boolean
- Annotations
- @inline()
- def isSymbolicIdent(tok: Token): Boolean
- def isSymbolicName(name: String): Boolean
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def rhsIsCommentedOut(formatToken: FormatToken): Boolean
- def shouldBreak(ft: FormatToken)(implicit style: ScalafmtConfig): Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()