At the moment I have:
switch (numberString) {
case "FOUR": number = 4; break;
case "FIVE": number = 5; break;
}
It's a simple switch statement, but if I use Eclipse's format key, Ctrl+Shift+F, all of a sudden it turns into something 10 lines longer by breaking up case, value =, and break; all on to different lines.
Is there anyway to change the formatter to ignore switch statements?
Disable formatting for a piece of codeGo to Window > Preferences > Java > Code Style > Formatter.
I'm using Eclipse Oxygen 3a and I found the setting to indent the case
statements within switch cases:
Preferences
> Java
> Code Style
> Formatter
> Edit...
> Indent
Check Statements within 'switch' body
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With