简体   繁体   中英

IntelliJ Scala Case Class Indentation

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM