Class/Object

org.scalafmt.config

Align

Related Docs: object Align | package config

Permalink

case class Align(stripMargin: Boolean = true, openParenCallSite: Boolean = false, openParenDefnSite: Boolean = false, tokens: Seq[AlignToken] = Seq(AlignToken.caseArrow), arrowEnumeratorGenerator: Boolean = false, ifWhileOpenParen: Boolean = false, tokenCategory: Map[String, String] = Map(), treeCategory: Map[String, String] = ...) extends Decodable[Align] with Product with Serializable

stripMargin

If set, indent lines with a strip-margin character in a multiline string constant relative to the opening quotes (or the strip-margin character if present) on the first line; otherwise, indent relative to the beginning of the first line, as usual.

openParenCallSite

If true AND bin-packing is true, then call-site arguments won't be aligned by the opening parenthesis. For example, this output will be disallowed function(a, b, c)

openParenDefnSite

Same as openParenCallSite, except definition site.

tokens

The tokens to vertically align by. The "owner" is the scala.meta.Tree.getClass.getName of the deepest tree node that "owns" the token to align by. Examples: align.tokens = ["="] // align = owned by any tree node (not recommended) align.tokens = [ { code = "=", owner = "Param" } // align = when owned by parameter tree nodes ] Pro tip. if you use for example preset = defaultWithAlign and want to add one extra token (for example "|>") to align by, write align.tokens.add = [ "|> ] NOTE. Adding more alignment tokens may potentially decrease the vertical alignment in formatted output. Customize at your own risk, I recommend you try and stick to the default settings.

arrowEnumeratorGenerator

If true, aligns by <- in for comprehensions.

ifWhileOpenParen

If true, aligns by ( in if/while/for. If false, indents by continuation indent at call site.

tokenCategory

Customize which token kinds can align together. By default, only tokens with the same Token.productPrefix align. To for example align = and <-, set the values to: Map("Equals" -> "Assign", "LeftArrow" -> "Assign") Note. Requires mixedTokens to be true.

treeCategory

Customize which tree kinds can align together. By default, only trees with the same Tree.productPrefix align. To for example align Defn.Val and Defn.Var, set the values to: Map("Defn.Var" -> "Assign", "Defn.Val" -> "Assign") Note. Requires mixedOwners to be true.

Linear Supertypes
Serializable, Serializable, Product, Equals, Decodable[Align], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Align
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Decodable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Align(stripMargin: Boolean = true, openParenCallSite: Boolean = false, openParenDefnSite: Boolean = false, tokens: Seq[AlignToken] = Seq(AlignToken.caseArrow), arrowEnumeratorGenerator: Boolean = false, ifWhileOpenParen: Boolean = false, tokenCategory: Map[String, String] = Map(), treeCategory: Map[String, String] = ...)

    Permalink

    stripMargin

    If set, indent lines with a strip-margin character in a multiline string constant relative to the opening quotes (or the strip-margin character if present) on the first line; otherwise, indent relative to the beginning of the first line, as usual.

    openParenCallSite

    If true AND bin-packing is true, then call-site arguments won't be aligned by the opening parenthesis. For example, this output will be disallowed function(a, b, c)

    openParenDefnSite

    Same as openParenCallSite, except definition site.

    tokens

    The tokens to vertically align by. The "owner" is the scala.meta.Tree.getClass.getName of the deepest tree node that "owns" the token to align by. Examples: align.tokens = ["="] // align = owned by any tree node (not recommended) align.tokens = [ { code = "=", owner = "Param" } // align = when owned by parameter tree nodes ] Pro tip. if you use for example preset = defaultWithAlign and want to add one extra token (for example "|>") to align by, write align.tokens.add = [ "|> ] NOTE. Adding more alignment tokens may potentially decrease the vertical alignment in formatted output. Customize at your own risk, I recommend you try and stick to the default settings.

    arrowEnumeratorGenerator

    If true, aligns by <- in for comprehensions.

    ifWhileOpenParen

    If true, aligns by ( in if/while/for. If false, indents by continuation indent at call site.

    tokenCategory

    Customize which token kinds can align together. By default, only tokens with the same Token.productPrefix align. To for example align = and <-, set the values to: Map("Equals" -> "Assign", "LeftArrow" -> "Assign") Note. Requires mixedTokens to be true.

    treeCategory

    Customize which tree kinds can align together. By default, only trees with the same Tree.productPrefix align. To for example align Defn.Val and Defn.Var, set the values to: Map("Defn.Var" -> "Assign", "Defn.Val" -> "Assign") Note. Requires mixedOwners to be true.

Type Members

  1. type T = Align

    Permalink
    Definition Classes
    Decodable

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. implicit def alignReader: ConfDecoder[Seq[AlignToken]]

    Permalink
  5. val arrowEnumeratorGenerator: Boolean

    Permalink

    If true, aligns by <- in for comprehensions.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def baseDecoder: ConfDecoder[Align]

    Permalink
    Attributes
    protected[org.scalafmt.config]
    Definition Classes
    AlignDecodable
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def decodePresets(conf: Conf, presets: PartialFunction[Conf, Align]): Option[Configured[(Align, Conf)]]

    Permalink
    Attributes
    protected
    Definition Classes
    Decodable
  10. implicit final def decoder(implicit presets: PartialFunction[Conf, Align]): ConfDecoder[Align]

    Permalink
    Definition Classes
    Decodable
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. val ifWhileOpenParen: Boolean

    Permalink

    If true, aligns by ( in if/while/for.

    If true, aligns by ( in if/while/for. If false, indents by continuation indent at call site.

  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. val openParenCallSite: Boolean

    Permalink

    If true AND bin-packing is true, then call-site arguments won't be aligned by the opening parenthesis.

    If true AND bin-packing is true, then call-site arguments won't be aligned by the opening parenthesis. For example, this output will be disallowed function(a, b, c)

  20. val openParenDefnSite: Boolean

    Permalink

    Same as openParenCallSite, except definition site.

  21. val stripMargin: Boolean

    Permalink

    If set, indent lines with a strip-margin character in a multiline string constant relative to the opening quotes (or the strip-margin character if present) on the first line; otherwise, indent relative to the beginning of the first line, as usual.

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

    Permalink
    Definition Classes
    AnyRef
  23. val tokenCategory: Map[String, String]

    Permalink

    Customize which token kinds can align together.

    Customize which token kinds can align together. By default, only tokens with the same Token.productPrefix align. To for example align = and <-, set the values to: Map("Equals" -> "Assign", "LeftArrow" -> "Assign") Note. Requires mixedTokens to be true.

  24. val tokens: Seq[AlignToken]

    Permalink

    The tokens to vertically align by.

    The tokens to vertically align by. The "owner" is the scala.meta.Tree.getClass.getName of the deepest tree node that "owns" the token to align by. Examples: align.tokens = ["="] // align = owned by any tree node (not recommended) align.tokens = [ { code = "=", owner = "Param" } // align = when owned by parameter tree nodes ] Pro tip. if you use for example preset = defaultWithAlign and want to add one extra token (for example "|>") to align by, write align.tokens.add = [ "|> ] NOTE. Adding more alignment tokens may potentially decrease the vertical alignment in formatted output. Customize at your own risk, I recommend you try and stick to the default settings.

  25. val treeCategory: Map[String, String]

    Permalink

    Customize which tree kinds can align together.

    Customize which tree kinds can align together. By default, only trees with the same Tree.productPrefix align. To for example align Defn.Val and Defn.Var, set the values to: Map("Defn.Var" -> "Assign", "Defn.Val" -> "Assign") Note. Requires mixedOwners to be true.

  26. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Decodable[Align]

Inherited from AnyRef

Inherited from Any

Ungrouped