如何在 IntelliJ IDEA 中为 Scala 配置代码风格

How to configure code style for Scala in IntelliJ IDEA

IntelliJ 像这样格式化我的测试代码:

  test("a configuration without classpath to analyze is not valid") {
                                                                  Configuration(
                                                                    None,
                                                                    Seq(),
                                                                    Seq(),
                                                                    Map(),
                                                                        Some(PrintConfiguration(print = Always("output")))
                                                                  ) should not be ('valid)
                                                                }

我希望我们都同意这是一种相当愚蠢的做法。

我如何配置 IntelliJ,使其将 Configuration 和属于它的所有内容移到左侧,相对于 test 缩进两个空格?

澄清一下:大部分代码都正确缩进,只是大括号中的代码块,即参数相对于左花括号对齐,而不是相对于函数调用的开头对齐。

设置 -> CodeStyle -> Scala 怎么样:

同时确保删除 "align when multiline settings" 或在“环绕和大括号”选项卡上设置 "Do not align block expression parameters"。