Intellij IDEA Java code formatting: can I force a newline after public and before a method return type?

huangapple go评论94阅读模式
英文:

Intellij IDEA Java code formatting: can I force a newline after public and before a method return type?

问题

我想让我的Java方法声明看起来像:

static public
boolean method1(int arg1) {
...
}

其中在public之后和boolean之前有一个换行。在IntelliJ IDEA中有办法实现这个吗?

英文:

I would like my java method declarations to look like:

static public
boolean method1(int arg1) {
...
}

where there is a newline after public and before boolean. Is there a way to do that in IntelliJ IDEA?

答案1

得分: 1

这是一个相关的帖子。
Software Engineering Stack Exchange – 在C中将函数类型和方法名称放在不同行的原因

您可以在 设置 > 编辑器 > 代码样式 > Java 中找到此选项。
标题是 "Modifer list",选项是 "Wrap after modifier list"

英文:

Here is a relevant post.
Software Engineering Stack Exchange – Reason for placing function type and method name on different lines in C.

You can find this in Settings > Editor > Code Style > Java.
The title is, "Modifer list", and the option is "Wrap after modifier list".

huangapple
  • 本文由 发表于 2023年6月29日 03:00:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76576002.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定