I’m looking for an automatic way in eclipse to reformat curly braces to K&R style, eliminating braces for single statements if, etc. Is there such a way?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Before you reformat you need to customize the formatter settings in the Preferences Dialog
Java/ Code Style / Formatterto your K&R settings if the default settings don’t match your requirements.The Preferences Dialog is opened from
Mainmenu / Window / PreferencesYou can even configure a save action
Java / Editor / Save Actionto format source code on save.