Auto Formatting...

I've inherited a lot of code that is not formatted in the way that I'd like. Is there a way for me to select an area and then have it reformat the code for me.

This is beyond mere indentation. It includes where opening curly braces appear for instance (I like 'em on the same line as the preceeding code, my predessesor likes 'em on their own line.

Basically, I'd like to apply the code formatting options from my 'Code Style' options to a selected block of code.

Is this a new feature request or is there a simple way to do this?

Joe

4 comments
Comment actions Permalink

Select a block of code and press Ctrl-Alt-L

Eugene


"joe martinez" <alanbrown@pacbell.net> wrote in message
news:8191145.1065827922369.JavaMail.itn@is.intellij.net...

I've inherited a lot of code that is not formatted in the way that I'd

like. Is there a way for me to select an area and then have it reformat the
code for me.
>

This is beyond mere indentation. It includes where opening curly braces

appear for instance (I like 'em on the same line as the preceeding code, my
predessesor likes 'em on their own line.
>

Basically, I'd like to apply the code formatting options from my 'Code

Style' options to a selected block of code.
>

Is this a new feature request or is there a simple way to do this?

>

Joe



0
Comment actions Permalink

Or (better?) select a directory where all sources lie in a project view and
press CtrlAltL.

--

Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


"Eugene Belyaev (JetBrains)" <beg@jetbrains.com> wrote in message
news:bm7fgk$io6$1@is.intellij.net...

Select a block of code and press Ctrl-Alt-L

>

Eugene

>
>

"joe martinez" <alanbrown@pacbell.net> wrote in message
news:8191145.1065827922369.JavaMail.itn@is.intellij.net...

I've inherited a lot of code that is not formatted in the way that I'd

like. Is there a way for me to select an area and then have it reformat

the

code for me.
>

This is beyond mere indentation. It includes where opening curly braces

appear for instance (I like 'em on the same line as the preceeding code,

my

predessesor likes 'em on their own line.
>

Basically, I'd like to apply the code formatting options from my 'Code

Style' options to a selected block of code.
>

Is this a new feature request or is there a simple way to do this?

>

Joe

>
>


0
Comment actions Permalink

Maxim Shafirov (JetBrains) wrote:

Or (better?) select a directory where all sources lie in a project view and
press CtrlAltL.


The key combination corresponds with the Tools -> Reformat Code menu
item, if you're a person who prefers using menus.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

Thanks everyone. I was searching on autoformat and format but not on reformat.

0

Please sign in to leave a comment.