-
在idea中将Formatter markers打开
-
在代码所在的类前面加
// @formatter:off
-
在要格式化的代码块前加
// @formatter:off // @formatter:on
在要格式化的代码块后加// @formatter:off
-
然后格式化即可,上图红框中的代码会格式化,而其他部分不会格式化
在idea中将Formatter markers打开
在代码所在的类前面加
// @formatter:off
在要格式化的代码块前加 // @formatter:off // @formatter:on
在要格式化的代码块后加 // @formatter:off
然后格式化即可,上图红框中的代码会格式化,而其他部分不会格式化
本文标题:idea代码部分格式化
本文链接:https://www.haomeiwen.com/subject/zajoiftx.html
网友评论