我似乎无法找到格式化程序设置来阻止Eclipse将块样式声明放在同一行上。
例如,如果我输入如下代码:
private string[] myData={
"someValue1",
"someValue2",
"someValue3",
"someValue4",
"someValue5",
"someValue5"
}
运行Eclipse的Auto Formatter后,之前的声明如下:
private string[] myData={
"someValue1", "someValue2", "someValue3", "someValue4", "someValue5", "someValue5"};
有没有办法避免这种情况?
答案 0 :(得分:1)
您可以通过添加以下标记来切换格式化程序:
//@formatter:off
private string[] myData = {
"someValue1",
"someValue2",
"someValue3",
"someValue4",
"someValue5",
"someValue5"
}
//@formatter:on
答案 1 :(得分:1)