eclipse条件格式化大括号仅适用于多行 [英] eclipse conditional formatting braces only for multiple lines
本文介绍了eclipse条件格式化大括号仅适用于多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何方式来配置eclipse只包含大括号中的if语句,如果它是多行,并留下单行语句?例如
Any way to configure eclipse to only wrap if statements in braces if it is multiple lines, and leave alone single line statements? e.g.
if (x == y) z();
if (x == y){
z();
}
推荐答案
使用可以使用 // formatter:off
和 // formatter:on
标签可以在给定的代码行范围内打开或关闭格式化。
Use can use //formatter:off
and //formatter:on
tags to switch on or switch off formatting in a given range of code lines.
参考这篇文章:如何使用eclipse的代码格式化程序在case之后删除新行?
这篇关于eclipse条件格式化大括号仅适用于多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文