How to keep IntelliJ IDEA from rearranging javadoc tags?

950 views Asked by At
/**
 * Comment.
 *
 * <p>Hello
 *
 * @author me ([email protected])
 * @version $Id$
 * @since 0.1
 * @checkstyle ClassDataAbstractionCoupling (500 lines)
 * @checkstyle ClassFanOutComplexity (500 lines)
 */

When I reformat my code with Ctrl+Alt+L, the @since is placed after the @checkstyle tags. Is there any way to disable javadoc tag rearrangement on code reformatting?

2

There are 2 answers

1
Bohuslav Burghardt On BEST ANSWER

You can uncheck Enable JavaDoc formatting in Settings/Code Style/Java/JavaDoc, which should fix the problem.

IntelliJ IDEA settings

However this means that no other formatting will be performed (wrapping, alignining, etc). I haven't found a way to disable just the rearranging of tags.

0
rocket-3 On

You can also use this plugin with disabled JavaDoc formatting in IDEA.

With that combination you still have an asterisk * inserted at newline, and you can configure all generated JavaDoc templates for each part of code.

It also has a feature of upgrade existing JavaDoc.