简体   繁体   中英

How to fix the formatting in Eclipse Mars?

Apparently there are some problems with formatting in Eclipse Mars. An issue has already been opened. Also there seems to be a bug that has supposedly been fixed.

My problem is that source code that is inside braces does not get indented. I'm using:

Version: Mars Milestone 6 (4.5.0M6)
Build id: 20150326-0744

Does anyone have a workaround? Thanks.

edit: this is what the formatter does:

public class Junk {
int foo() {
int x=1;
System.out.println(x);
for(int i=0;i<2;i++) {
    x++;
    for(int j=0;i<2;i++) {
    x++;
    }
}
return x;
}

}

As you said it is the bug of eclipse already I faced. I could fix that using version 4.5.1.

Please use following link to download bug fixed version. http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=R4_5_maintenance&id=3a54e1075910dfdcd0ae404611dd26506404e6e7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM