At 03:52 14.12.01 +0000, you wrote:
>1.
>Enable Surround with even when there's no content on the current line.
>
>There's many a time when I want an if/else, try/catch/finally, ... with
>nothing inside.
>This obviates the need to create (and remember) live templates for this.
I used very simple live templates:
if|
expands to
if (|) {
}
ife|
expands to
if (|) {
}
else {
}
This works fine and is very easy to define.
Tom
>2.
>Many times (it seems almost always :) I want the if/else to put the
>existing code in the else block.
>
>Do you see a way to create/change an IF/else and if/ELSE that puts the
>existing code in the proper block.
Good idea.
But perhaps better: add an refactoring, that inverts the condition and
swaps the if/else branches.
Example:
if (value == null) {
doSomethingWhenNull();
}
else {
doSomethingElse(value);
}
would be converted to:
if (value != null) {
doSomethingElse(value);
}
else {
doSomethingWhenNull();
}
Tom
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features