我有以下代码:
record FooBar(@NotNull String foo, @NotNull Integer bar) {
}
我希望 Intellij IDEA 将其格式化为:
record FooBar(
@NotNull
String foo,
@NotNull
Integer bar
) {
}
这可能吗?
我能得到的最接近的是:
record FooBar(
@NotNull String foo,
@NotNull Integer bar
) {
}
这并不理想,因为注释的数量可能会有所不同。
我用来得到这个结果的选项是
Record components Wrap always
Align when multiline true
New line after '(' true
Place ')' on new line true
最佳答案
目前这似乎不受支持 - 我已经打开了 a ticket在 JetBrains 问题跟踪器上。
关于java - 使用 Intellij IDEA 格式化类似于类的 Java 记录字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72992425/