Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - autoformatting of code

This might be nitpicky, but I like all my code to be in the form

function()
{
   code
}

instead of

function() {
   code
}

When Eclipse autogenerates a class for me, it will use the latter format, and so I have to go through and change all of the generated methods. Is there anyway to make it so it will put it in the first format automatically? I'm using java if that makes a difference.

like image 586
Tim Avatar asked Dec 13 '22 04:12

Tim


2 Answers

Click "edit" on the following panel to control the formatter:

enter image description here

like image 199
Java42 Avatar answered Dec 26 '22 16:12

Java42


Yup. Look in Preferences -> Java -> Cody Style -> Formatter. you can alter a BUNCH of styles in there.

I think what you're looking for is in the Braces tab

like image 39
JohnnyK Avatar answered Dec 26 '22 17:12

JohnnyK