All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalafmt.AlignToken.scala Maven / Gradle / Ivy

There is a newer version: 2.0.0-RC1
Show newest version
package org.scalafmt

/**
  * Configuration option for aligning tokens.
  *
  * @param code string literal value of the token to align by.
  * @param owner regexp for class name of scala.meta.Tree "owner" of [[code]].
  */
case class AlignToken(code: String, owner: String)

object AlignToken {
  val applyInfix = "Term.ApplyInfix"
  val caseArrow = AlignToken("=>", "Case")

  val default = Set(
      caseArrow,
      AlignToken("extends", "Defn.(Class|Trait|Object)"),
      AlignToken("//", ".*"),
      AlignToken("{", "Template"),
      AlignToken("}", "Template"),
      AlignToken("%", applyInfix),
      AlignToken("%%", applyInfix),
      AlignToken("⇒", "Case"),
      AlignToken("<-", "Enumerator.Generator"),
      AlignToken("←", "Enumerator.Generator"),
      AlignToken("->", applyInfix),
      AlignToken("→", applyInfix),
      AlignToken("=", "(Enumerator.Val|Defn.(Va(l|r)|Def|Type))")
  )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy