Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify IntelliJ javadoc template

Is there a way to modify the template IntelliJ uses for a method's Javadoc?

In particular, I want my javadoc comments to look like this:

/********************
 * 
 *  Comment here
 *
 *********************/

However, when I reformat the code, the javadoc ends up looking like this:

/**
 * ******************
 * 
 *  Comment here
 *
    ********************
 */
like image 844
Zack Avatar asked Aug 19 '11 15:08

Zack


1 Answers

It doesn't seem like you want JavaDoc comments then, as they are defined to look like how IntelliJ is making them.

  • Format of a Doc Comment
  • Structure of a JavaDoc comment

You can disable JavaDoc formatting:

  1. Settings > Project Settings > Code Style > JavaDoc
  2. Uncheck Enable JavaDoc formatting

This way, you can have your multi-line comments not get reformatted as JavaDoc comments. IntelliJ is identifying them (correctly) as JavaDoc comments since they have two asterisks.

You can also change them to regular multi-line comments (not JavaDoc comments) by adding a space before the second asterisk (e.g. /* ****************), which should also have IntelliJ not reformat them.

like image 136
CrackerJack9 Avatar answered Sep 24 '22 18:09

CrackerJack9