如何修复智能奇怪的字符串缩进?

2022-09-01 10:48:48

Intellij一直在像这样格式化我的字符串,这很烦人,我该如何修复它,以便行都对齐?

    PreparedStatement p = s.prepare(
            "select distinct resource, uid, role "+
                    "from role " +
                    "where person_uuid=? " +
                    "order by role, resource, uid");

即:

    PreparedStatement p = s.prepare(
            "select distinct resource, uid, role "+
            "from role " +
            "where person_uuid=? " +
            "order by role, resource, uid");

答案 1

您可以在“项目设置”->代码样式->Java->换行和大括号中调整格式。您要查找的选项应该是“方法调用参数”或“二进制表达式”


答案 2

推荐