如何强制IntellJ代码格式化程序在不同级别上自动包含的参数列表,而不是包装的链式方法调用:
编辑:有关更好的问题说明,请参阅更新的示例。如果我将每个连续方法调用包装到新行,则默认格式化程序按预期工作。只有当我想在每行留下一个或多个点时才会出现问题:
包装:
new Something()
.chained("arg1", "arg2", "very long arg I want to see in new line")
.chained("arg1", "arg2", "very long arg I want to see in new line")
.extra().chained("arg1", "arg2", "very long arg I want to see in new line")
.extra().chained("arg1", "arg2", "very long arg I want to see in new line");
我希望这样的事情:
new Something()
.chained("arg1", "arg2",
"very long arg I want to see in new line")
.chained("arg1", "arg2",
"very long arg I want to see in new line")
.extra().chained("arg1", "arg2",
"very long arg I want to see in new line")
.extra().chained("arg1", "arg2",
"very long arg I want to see in new line");
但结果是:
new Something()
.chained("arg1", "arg2",
"very long arg I want to see in new line")
.chained("arg1", "arg2",
"very long arg I want to see in new line")
.extra().chained("arg1", "arg2",
"very long arg I want to see in new line")
.extra().chained("arg1", "arg2",
"very long arg I want to see in new line");