4

This question may have been asked, but I could not find a suitable answer, so I'm posting this as a question here. The problem is that when I create a new case class, the indentation looks so wierd.

case class SomeCaseClass(
                         id: Int
                        )

I would however prefer it to be like this:

case class SomeCaseClass(
  id: Int
)

I would just like to know which option in IntelliJ would allow me to get away with this awkward indentation.

joesan
  • 13,963
  • 27
  • 95
  • 232
  • Check out the [scalafmt](http://scalameta.org/scalafmt/) plugin for IDEA. – Yuval Itzchakov May 23 '17 at 05:20
  • 1
    Possible duplicate of [IntelliJ Scala Plugin's case class indentation is absurd](https://stackoverflow.com/questions/26880677/intellij-scala-plugins-case-class-indentation-is-absurd) – foobarbaz Mar 22 '19 at 15:21

1 Answers1

3

Ok I figured out how to do this. Here is what needs to be done:

  1. If you are on a Mac, select IntelliJ -> Preferences
  2. Select Editor -> Code Style -> Scala
  3. In the "Wrapping and Braces" tab, uncheck "Indent braced arguments"

Hope this helps someone that might run into the same issue!

joesan
  • 13,963
  • 27
  • 95
  • 232