This is for IntelliJ 2016.2.
I'm cleaning up some code that's causing CheckStyle violations and halting our CI build, and it appears to be happening because of IntelliJ's code style rules. I can fix these manually, but there are two problems with that: the editor applies these rules indiscriminately and it's a lot to fix manually. And if anyone runs code formatting again, it sets the indentation back the way it wants.
Specifically, the indentation on multiline method signatures looks like this:
And I would like the parameters on subsequent lines to be indented 4 spaces to the right of the start of the previous line, not the opening parenthesis.
Interestingly, format-as-you-type does this correctly for me, but when I use the code formatter it reformats it as above.
I can get some of the way by going to Tabs and Indents in the preferences and setting "continuation indent" to 0:
But this rule gets applied universally, making other stuff look really bad, and it doesn't accept negative values.
I've gone to "Editor.Code Style.Java.Wrapping and Braces.Method declaration parameters" in the preferences and tried just about everything there. I have "Chop down if long", but because of the indentation rule, this makes the line longer. Nowhere do I see a way to specify where it should start the indentation from or how much it should indent the line.
This, combined with the observation that formatting for method calls exhibit expected behavior (but, aggravatingly, not constructor calls!), makes me think that this is a bug. IntelliJ's formatter appears to be hard-coded to use the continuation indent from the open parenthesis, and not the method declaration itself.
Is there anything I have missed or some viable workaround?