I think it would be nice to have IDEA auto format a block of code after you close it with '}' or even insert the '}' for you.
For example if I had the code in a class:
public void method(intvar) {
System.out.println("Value = " + var);
}
and I wanted to change it to this:
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);
}
}
my sequence of thought would go (where | is the caret):
public void method(intvar) {
if (var < 10) {|
System.out.println("Value = " + var);
}
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);|
}
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);
|
}
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);
}|
}
public void method(intvar) {
if (var < 10) {
|System.out.println("Value = " + var);
}
}
What would be useful is at stage 2->3, when enter is typed, is to have the closing brace inserted by IDEA and the newly created block format itself (the caret is left after the inserted } at the end of the block).
I know this feature is available via the Surround With refactoring but I think doing it this way allows for a more flexible coding style.
Description
I think it would be nice to have IDEA auto format a block of code after you close it with '}' or even insert the '}' for you.
For example if I had the code in a class:
public void method(intvar) {
System.out.println("Value = " + var);
}
and I wanted to change it to this:
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);
}
}
my sequence of thought would go (where | is the caret):
public void method(intvar) {
if (var < 10) {|
System.out.println("Value = " + var);
}
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);|
}
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);
|
}
public void method(intvar) {
if (var < 10) {
System.out.println("Value = " + var);
}|
}
public void method(intvar) {
if (var < 10) {
|System.out.println("Value = " + var);
}
}
What would be useful is at stage 2->3, when enter is typed, is to have the closing brace inserted by IDEA and the newly created block format itself (the caret is left after the inserted } at the end of the block).
I know this feature is available via the Surround With refactoring but I think doing it this way allows for a more flexible coding style.