Jens Schauder
Jens Schauder

Reputation: 81862

How to configure code style for Scala in IntelliJ IDEA

IntelliJ formats my test code like this:

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

I hope we all agree that this is a rather stupid way to do this.

How can I configure IntelliJ in so that it moves Configuration and everything belonging to it over to the left, two spaces indented relative to test?

To clarify: most of the code gets indented properly, just code blocks in curly braces, that are parameters get aligne relative to the opening curly brace, not relative to the beginning of the function call.

Upvotes: 7

Views: 7283

Answers (1)

dk14
dk14

Reputation: 22374

How about Settings -> CodeStyle -> Scala:

enter image description here

Also make sure to remove the "align when multiline settings" or set the "Do not align block expression parameters" on the Wrapping and Braces tab.

Upvotes: 8

Related Questions