Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top