How to customize code style for Scala in IntelliJ IDEA

IntelliJ formats my test code as follows:

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

Hopefully we all agree that this is a pretty dumb way to do this.

How to configure IntelliJ so that it moves Configuration and everything that belongs to it on the left, two spaces indented relative to test ?

To clarify: most of the code is indented properly, only the code blocks in curly brackets, which are parameters, are aligned with the open curly bracket, and not with respect to the start of the function call.

+6
source share
1 answer

How about settings -> CodeStyle -> Scala:

enter image description here

Also make sure that you delete “align with multi-line settings” or set “Do not align block expression parameters” on the “Wrap and Bindings” tab.

+6
source

Source: https://habr.com/ru/post/984601/


All Articles