case class Align(allowOverflow: Boolean = false, multiline: Boolean = false, stripMargin: Boolean = true, closeParenSite: Boolean = false, openParenCallSite: Boolean = false, openParenCtrlSite: Boolean = false, openParenDefnSite: Boolean = false, openParenTupleSite: Option[Boolean] = None, tokens: Seq[AlignToken] = Seq(AlignToken.caseArrow), arrowEnumeratorGenerator: Boolean = false, tokenCategory: Map[String, String] = Map(), treeCategory: Map[String, String] = Map( "Defn.Val" -> "given/val/var/def", "Defn.Var" -> "given/val/var/def", "Defn.Def" -> "given/val/var/def", "Defn.GivenAlias" -> "given/val/var/def", "Defn.Class" -> "class/object/trait/enum", "Defn.Object" -> "class/object/trait/enum", "Defn.Trait" -> "class/object/trait/enum", "Defn.Enum" -> "class/object/trait/enum", "Enumerator.Generator" -> "for", "Enumerator.Val" -> "for" )) extends 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)
- openParenCtrlSite
If true, aligns by ( in if/while/for. If false, indents by continuation indent at call site.
- 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."+" = [ "|> ] 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.- tokenCategory
Customize which token kinds can align together. By default, only tokens with the same
Token.productPrefixalign. 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.productPrefixalign. 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.
- Alphabetic
- By Inheritance
- Align
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Align(allowOverflow: Boolean = false, multiline: Boolean = false, stripMargin: Boolean = true, closeParenSite: Boolean = false, openParenCallSite: Boolean = false, openParenCtrlSite: Boolean = false, openParenDefnSite: Boolean = false, openParenTupleSite: Option[Boolean] = None, tokens: Seq[AlignToken] = Seq(AlignToken.caseArrow), arrowEnumeratorGenerator: Boolean = false, tokenCategory: Map[String, String] = Map(), treeCategory: Map[String, String] = Map(
"Defn.Val" -> "given/val/var/def",
"Defn.Var" -> "given/val/var/def",
"Defn.Def" -> "given/val/var/def",
"Defn.GivenAlias" -> "given/val/var/def",
"Defn.Class" -> "class/object/trait/enum",
"Defn.Object" -> "class/object/trait/enum",
"Defn.Trait" -> "class/object/trait/enum",
"Defn.Enum" -> "class/object/trait/enum",
"Enumerator.Generator" -> "for",
"Enumerator.Val" -> "for"
))
- 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)
- openParenCtrlSite
If true, aligns by ( in if/while/for. If false, indents by continuation indent at call site.
- 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."+" = [ "|> ] 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.- tokenCategory
Customize which token kinds can align together. By default, only tokens with the same
Token.productPrefixalign. 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.productPrefixalign. 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.
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
- val allowOverflow: Boolean
- val arrowEnumeratorGenerator: Boolean
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val closeParenSite: Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getOpenParenTupleSite: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val multiline: 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()
- val openParenCallSite: Boolean
- val openParenCtrlSite: Boolean
- val openParenDefnSite: Boolean
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val stripMargin: Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val tokenCategory: Map[String, String]
- val tokens: Seq[AlignToken]
- val treeCategory: Map[String, String]
- 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()