IntelliJ allow brackets on same line when empty but not when single statement
已回答
Simply put, in reference to bracketed statements such as in try/catch, if/else if/else, methods, etc., I would like to allow :
try {
//Code that may throw an exception
}
catch(RandomException e) {}
And this:
try {
//Code that may throw an exception
}
catch(RandomException e) {
e.printStackTrace();
}
But not this:
try {
//Code that may throw an exception
}
catch(RandomException e) { e.printStackTrace(); }
Essentially, I want to be able to have brackets on the same line ONLY when the block is empty and not if there are any statements within the block.
Is there any way to configure the Java Code Style Scheme such that the constraints above are met?
请先登录再写评论。
This seems to be a duplicate of IDEA-126070, which unfortunately would mean that this has not been implemented.