Autoformat on Save

Is there a way to have IntelliJ autoformat on save the way eclipse does?  I'd like to format changed lines.  The problem I'm seeing is that my JavaDoc is not autoformatted, not even when I explicitly tell it to.

6 comments
Comment actions Permalink

Hi Sean,

Please ensure that 'enable javadoc formatting' option is set at the javadoc code style settings.

Denis

0
Comment actions Permalink

Yep, that's enabled (by default).  It's still not putting a blank line between description and @return.  The option is enabled.

0
Comment actions Permalink

Am I right understanding that you have a code like below:

/**                               
 * This is my description         
 * @return                        
 */                               
@Override                         
public JComponent getComponent() {
  return myComponent;             
}                                 


The when you invoke 'Reformat' action and the code doesn't look like below now:

/**                               
 * This is my description         
 *                                
 * @return                        
 */                               
@Override                         
public JComponent getComponent() {
  return myComponent;             
}                                 


Denis

0
Comment actions Permalink

Correct, invoking autoreformat _does not_ add the blank line in the javadoc.

0
Comment actions Permalink

Do you mean 'reformat' under 'autoreformat'?

Please provide your code style settings '*.xml' files (contents of the 'codestyles' folder under 'config dir').

Denis

0
Comment actions Permalink

I meant, invoking "reformat code" (settings>keymap>all actions>main menu>code>reformat code) does not reformat the javadoc, though it does work on other code.

There is nothing in the codestyles directory.  This is probably because I'm using the default settings.

0

Please sign in to leave a comment.