Chop one argument, chop them all
Answered
I'm a line chopper when it comes to code styling. I like the "Chop if long" setting, but what I can't seem to find is a way to request, "If you chop the arguments, continue to chop ALL of the argument for that method call (or parameter list)"
Otherwise, you end up with a strange formatting, where the first argument might be chopped, then the next N arguments are on a single line. That's pretty ugly.
Please sign in to leave a comment.
What language are you working with? Can you provide a sample code and the expected/actual result? Thanks.
E.g. for java it work for me: It always chops down the next method argument if the line exceeds right margin ("too long") - so that there is one element per line with proper indentation.
Hey Andrey,
Language is Java. What I'd like to see is this:
The chopping occurs, but it stops as soon as the next line of arguments does not hit the right margin.
Same concept for method definitions as well (the parameter list).
What options do you have for Preferences | Editor | Code Style | Java | Wrapping and Braces | Method declaration parameters? With Chop down if long it reformats as you describe for me.
If issue remains, provide your exported code style Scheme please.
I'm looking for the same settings, and I don't seem to find. Did you manage to find a solution for this Andrey Dernov?
Basically what I'm looking for is "Chop once, chop always" or "wrap once, wrap always". It's weird that IntelliJ doesn't provide this setting.
As mentioned above, with 'Preferences | Editor | Code Style | Java | Wrapping and Braces | Method declaration parameters' set to 'Chop down if long' or 'Wrap always' the code after applying formatting will look like:
Is this what you are looking for, or do you speak about some different formatting?