IntelliJ Scala Plugin's case class indentation is absurd

前端 未结 1 1247
既然无缘
既然无缘 2020-12-12 10:12

When a case class has many fields and their names are long, it is often a good idea to write each field in each line like:

case class Person (
  name: String         


        
相关标签:
1条回答
  • 2020-12-12 11:05

    Try File -> Settings... -> Code Style -> Scala

    There are lots of settings to customize your code formatting in there.

    In the "Wrapping and Braces" tab, under "Method declaration parameters":

    • check "use normal indent for parameters"
    • uncheck "Align when multiline"

    This will change it to the example you provided.

    If you want it to use the indenting in "Continuation indent" under "Tabs and Indent" you have to have both of the option above unchecked.

    0 讨论(0)
提交回复
热议问题