开发者

Modify IntelliJ javadoc template

开发者 https://www.devze.com 2023-03-29 13:53 出处:网络
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:

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
 *
    ********************
 */


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消