Vipin
Vipin

Reputation: 5223

How to remove space between object and method calls in eclipse

I am planning for code cleanup , lot of places I found code like below which is not easily readable.

enter image description here

To make it readable removing spaces between object and method call like as below

enter image description here

Is there any plugin or eclipse feature available to remove this kind of space automatically from code.

Upvotes: 1

Views: 421

Answers (2)

Ross Drew
Ross Drew

Reputation: 8246

If you highlight the code the press Ctrl+Shift+F, Eclipse will auto format the code highlighted as per the rules in Window | Preferences | Java | Code Style | Formatter so just set those rules as per your desire then auto format.

Specifically, in your case just Edit the Active Profile and adjust the settings on the Line Wrapping tab.

Valid as of Eclipse Kepler Service Release 2

Upvotes: 3

whoami
whoami

Reputation: 1627

Ctrl+A(Select All) and Ctrl+Shift+F(Format) to format your entire file or select the area where you want to format and press Ctrl+Shift+F.

Upvotes: 1

Related Questions