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.

0
6 comments
Avatar
Permanently deleted user

Hi Sean,

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

Denis

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

Do you mean 'reformat' under 'autoreformat'?

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

Denis

0
Avatar
Permanently deleted user

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.