美文网首页
idea代码部分格式化

idea代码部分格式化

作者: Lonely_Acmen | 来源:发表于2018-08-26 15:22 被阅读0次
  1. 在idea中将Formatter markers打开

  2. 在代码所在的类前面加
    // @formatter:off

  3. 在要格式化的代码块前加 // @formatter:off // @formatter:on
    在要格式化的代码块后加 // @formatter:off

  4. 然后格式化即可,上图红框中的代码会格式化,而其他部分不会格式化

相关文章

网友评论

      本文标题:idea代码部分格式化

      本文链接:https://www.haomeiwen.com/subject/zajoiftx.html