From digitalmars.D:71602
Robert Fraser wrote:
Mike wrote:
Yeah, I hate it when Eclipse starts to put my case statements on the wrong indentation level.
Both JDT and Descent let you choose. Window > Preferences > Java/D > Code Style > Formatter > Edit... > Indentation
I think I know what he means: unfortunately, Descent doesn't seem to pay attention to that setting when you're just typing code. If I try to type
void foo(int bar) {
switch (bar) {
case 1:
}
}
I instead get:
void foo(int bar) {
switch (bar) {
case 1:
}
}
Note the indenting of 'case'. This is with the checkbox for [Indent] "'case'/'default' statements within 'switch'" turned on. And it happens whether or not I press 'tab' before typing 'case'. (If I use tab to manually indent the 'case', it *unindents* the moment I hit 'e'!)
Pressing Ctrl-Shift-F fixes the indentation; this seems to be an auto-indenting issue, not a formatter issue.
(Descent 0.5.2.20080501, Eclipse 3.2.2 / M20070212-1330 (Ubuntu version: 3.2.2-5ubuntu2))
P.S. Mike replied:
Exactly. It seems to do it only with the first case, however.