Currently if I write use the following builder class Intellij will indent the following way
SomeClass.create()
.someMethod()
.someOtherMethod();
What I would like it to do is indent like this:
SomeClass.create()
.someMethod()
.someOtherMethod();
Does anybody know how to set this up?
While in the editor, select the necessary code fragment and press Ctrl+Alt+I . If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. On the appropriate language page, on the Tabs and Indents tab, specify the appropriate indents options and click OK.
Automatically detect indentsPress Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. Select the Detect and use existing file indents for editing checkbox. Apply the changes and close the dialog.
Produces the following when reformatting source:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With