문제

In visual studio If I type:

int x=5*6+2*3;

It will automatically format it to:

int x = 5 * 6 + 2 * 3;

In eclipse I have to press CTRL+SHIFT+F to do this.

Is there any way I can make it happen automatically like in visual studio??

Thanks

도움이 되었습니까?

해결책

PreferencesJavaCode StyleFormatterEdit 'Active Profile' → White SpacesExpressionsOperators (and the others)

Tick all desired boxes for white spaces, then Apply.

To inoke the formatter in the code editor, press CTRL + SHIFT + F (default).


You may also set the formatter to be invoked automatically on a Save Action, by going to PreferencesJavaEditorSave Actions → And tick Format Source Code, along with other desired configurations of course.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top