首页 > 解决方案 > IntelliJ 在使用 ctrl+alt+L 重新格式化时拆分我的代码

问题描述

ctrl+alt+L 像这样拆分我的代码:

public void message_should_be_displayed(String text) {
    qip.executeAssertEquals("Asserting if correct alert msg is displayed : ", text, qip.driver.switchTo()
            .alert()
            .getText());
}

如果我重新格式化,它会将最后两行放在单独的行中。知道如何解决这个问题吗?

标签: intellij-idea

解决方案


设置(macOS 上的首选项)| 编辑 | 代码风格 | 爪哇 | 包装和大括号 | 链式方法调用:不要换行。


推荐阅读