EclipseFormatterforJava是否可以配置为在包装时将函数调用的右括号放到新行?

EclipseFormatterforJava是否可以配置为在包装时将函数调用的右括号放到新行?,java,eclipse,code-formatting,Java,Eclipse,Code Formatting,Eclipse格式化程序和/或Java代码清理程序是否可以配置(或扩展)为在函数/方法调用的右括号前添加新行?到目前为止,我成功地将代码格式化如下: // some code here foo.aVeryLongMethodNameWhichCausesLineWraps( param1, param2); // and some other code here // some code here foo.aVeryLongMethodNameWhichCausesLineWr

Eclipse格式化程序和/或Java代码清理程序是否可以配置(或扩展)为在函数/方法调用的右括号前添加新行?到目前为止,我成功地将代码格式化如下:

// some code here
foo.aVeryLongMethodNameWhichCausesLineWraps(
    param1,
    param2);
// and some other code here
// some code here
foo.aVeryLongMethodNameWhichCausesLineWraps(
    param1,
    param2
);
// and some other code here
// some code here
foo.bar(
    nested(
        param1,
        param2
    )
);
// and some other code here
但我想要的是:

// some code here
foo.aVeryLongMethodNameWhichCausesLineWraps(
    param1,
    param2);
// and some other code here
// some code here
foo.aVeryLongMethodNameWhichCausesLineWraps(
    param1,
    param2
);
// and some other code here
// some code here
foo.bar(
    nested(
        param1,
        param2
    )
);
// and some other code here
对于嵌套调用,它应该如下所示:

// some code here
foo.aVeryLongMethodNameWhichCausesLineWraps(
    param1,
    param2);
// and some other code here
// some code here
foo.aVeryLongMethodNameWhichCausesLineWraps(
    param1,
    param2
);
// and some other code here
// some code here
foo.bar(
    nested(
        param1,
        param2
    )
);
// and some other code here

这可能吗?如果没有,是否有机会扩展格式化程序以提供这样的功能?

但是您知道,为什么这不是一个显而易见的想法? 对于没有参数的方法,它的行为如何

foo.averyLongMethodName导致换行(
);

看起来不太好,是吗? 当然,每种代码格式都有其优缺点,但如果您使用的API不是您办公室某个人的好API,而该人希望在其方法中包含10个参数,则这意味着您将拥有如下内容:

foo.bar(
嵌套(
参数1,
参数2,
参数3,
参数4,
第5条,
第6条,
第7条,
第八条,
param9
),
参数1,
参数2,
参数3,
参数4,
第5条,
第6条,
第7条,
第八条,
param9
);
通过使用Editbox插件,您可以减轻格式错误带来的痛苦:


Close vote reviewers:这个问题是有主题的,因为“关于通用计算硬件和软件的问题对于堆栈溢出来说是离题的,除非它们直接涉及主要用于编程的工具。”这里的情况显然就是这样。你所说的坏例子正是我所寻找的行为。它简化了代码扩散和审查。使用此格式可以很容易地跟踪参数的添加、删除和修改。