Skip to content

Commit

Permalink
Merge pull request #2732 from tgodzik/produce-lf
Browse files Browse the repository at this point in the history
Remove LF when soft keywords are used
  • Loading branch information
tgodzik committed Apr 19, 2022
2 parents 48244ff + cf2ba15 commit d21ee31
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ class ScannerTokens(tokens: Tokens, input: Input)(implicit dialect: Dialect) {
@classifier
trait CanEndStat {
def unapply(token: Token): Boolean = token match {
case SoftModifier() => false
case _: Ident | _: KwGiven | _: Literal | _: Interpolation.End | _: Xml.End | _: KwReturn |
_: KwThis | _: KwType | _: RightParen | _: RightBracket | _: RightBrace |
_: Underscore | _: Ellipsis | _: Unquote =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,23 @@ class InlineSuite extends BaseDottySuite {
)
}

test("transparent-trait-newlines") {
runTestAssert[Stat](
"""|transparent
|
|trait S""".stripMargin,
assertLayout = Some("transparent trait S")
)(
Defn.Trait(
List(Mod.Transparent()),
Type.Name("S"),
Nil,
Ctor.Primary(Nil, Name(""), Nil),
Template(Nil, Nil, Self(Name(""), None), Nil, Nil)
)
)
}

test("transparent-inline-with-constant") {
runTestAssert[Stat](
"""|transparent inline def f: String =
Expand Down

0 comments on commit d21ee31

Please sign in to comment.