java formatter无法换行_maven-java-formatter-plugin无法格式化comment

Flag used to include the comments during the formatting of the code snippet.

This flag can be combined with the following kinds:

Note also that it has an effect only when one or several format comments options for javadoc , block orline are set to true while calling format(int, String, int, int, int, String) or format(int, String, IRegion[], int, String) methods

For example, with the Eclipse default formatter options, the formatting of the following code snippet using K_COMPILATION_UNIT:

public class X {

/**

* This is just a simple example to show that comments will be formatted while processing a compilation unit only if the constant flag flag is set.

* @param str The input string

*/

void foo(String str){}}

F_INCLUDE_COMMENT will produce the following output:

public class X {

/**

* This is just a simple example to show that comments will be formatted while processing a compilation unit only if the constant flag flag is set.

*

* @param str The input string

*/

void foo(String str){

}

}

F_INCLUDE_COMMENT Adding this flavor to the kind given while formatting the same source (e.g.

K_COMPILATION_UNIT |

F_INCLUDE_COMMENTS) will produce the following output instead:

public class X {

/**

* This is just a simple example to show that comments will be formatted

* while processing a compilation unit only if the constant flag

* flag is set.

*

* @param str

* The input string

*/

void foo(String str){

}

}

F_INCLUDE_COMMENT

Note: Although we're convinced that the formatter should always include the comments while processing a kind of compilation unit, we have decided to add a specific flag to fix this formatter incorrect behavior. This will prevent all existing clients (e.g. 3.3 and previous versions) using theK_COMPILATION_UNIT kind to be broken while formatting.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值