Skip to content

Commit

Permalink
Merge pull request #1516 from dominics/space-annotation-ctor
Browse files Browse the repository at this point in the history
Add a space between constructor annotations and their parameter lists
  • Loading branch information
tanishiking authored Oct 10, 2019
2 parents fea0efc + 7df57dc commit 2958ad7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ class Router(formatOps: FormatOps) {
} =>
val modification: Modification = leftOwner match {
case _: Mod => Space
case _: Init => Space
case t: Term.Name
if style.spaces.afterTripleEquals &&
t.tokens.map(_.syntax) == Seq("===") =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ object A {
@Annotation
class B
@Singleton
class B @Inject()(val x: Int)
class B @Inject() (val x: Int)
@js.native
class C() {
def c = 5
Expand All @@ -157,7 +157,7 @@ object A {
class B

@Singleton
class B @Inject()(val x: Int)
class B @Inject() (val x: Int)

@js.native
class C() {
Expand Down Expand Up @@ -294,7 +294,7 @@ object a {
}

/** Implements the ..... /status/about, etc */
class Status @Inject()(ws: WSClient) {
class Status @Inject() (ws: WSClient) {
???
}

Expand Down
4 changes: 4 additions & 0 deletions scalafmt-tests/src/test/resources/spaces/Hacking.stat
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ maxColumn = 40
function(a, b, c)
>>>
function( a, b, c )
<<< Space between annotation and ctor argument list
class A @Inject()(b: C)
>>>
class A @Inject() (b: C)

0 comments on commit 2958ad7

Please sign in to comment.