IntelliJ代码样式定制

时间:2015-03-09 08:19:00

标签: java intellij-idea configuration

我们如何配置intellij代码样式,以便在重新格式化代码时

而不是:

enter image description here

我们得到这个: enter image description here

1 个答案:

答案 0 :(得分:2)

在使用方法链接(例如构建器)时,您可以覆盖intellij idea的默认行为以对齐链接方法。这样,在我看来,代码更具可读性。我认为您应该将其视为您提议的解决方案的替代方案。

  

设置 - >编辑 - >代码风格 - > Java - >环绕和支撑 - >链式   方法调用 - >多线时对齐

<强> BEFORE

enter image description here

<强> AFTER

enter image description here