Wrap after comma
Answered
Hello,
I have a code formatting issue. I need to set wrapping after comma if the expression is too long.
What I get at the moment:
if (softwareLicenseOpt.get().getOldKey().isPresent()) {
throw new ForbiddenException(
String.format("CASE 2.05 - wrong values, please use old key contactId %s, contractId %s and wekaNo %s.", contactId, contractId,
request.getWekaNo()));
}
What I want is:
if (softwareLicenseOpt.get().getOldKey().isPresent()) {
throw new ForbiddenException(String.format("CASE 2.05 - wrong values, please use old key contactId %s, contractId %s and wekaNo %s.", contactId,
contractId, request.getWekaNo()));
}
What do I need to set up to get the code formatted like I want?
Thanks in advance.
Greetings
Heiko
Please sign in to leave a comment.
To set up wraps in the way you need, you can open the
File|Settings / IntelliJIDEA|Preferenceswindow, choose in the left menuEditor|Code Style|Javaand switch to the Wrapping and Bracers tab. For your particular case, you need to change settings in the Method call arguments paragraph.Also, we can advise you to switch off the Line breaks option in the Keep when reformatting paragraph here. As an option, you can remove line breaks using the
Code | Reformat filedialog with Do not keep line breaks turned on or by pressing twice the Reformat code shortcut.