[英]How to format code like C# style for Java in Intellij?
I am using Intellij for Java development, but I prefer C# like coding style. 我正在使用Intellij进行Java开发,但是我更喜欢C#这样的编码风格。 How to format like C# code style?
如何格式化像C#代码样式? For example:
例如:
if()
{
/// do something
}
else
{
//// do something
}
Go to 去
File -> Settings -> Editor -> Code Style -> Java 文件->设置->编辑器->代码样式-> Java
Wrapping and Braces
tab. Wrapping and Braces
选项卡。 Braces placement
, there's a drop-down called Others
, change it to Next Line
. Braces placement
,有一个名为Others
的下拉菜单,将其更改为Next Line
。 (by default it is End of line). Braces placement
section( In class declaration
, In method declaration
) to Next Line
also. Braces placement
部分( In class declaration
, In method declaration
)的两个以前的下拉菜单也更改为Next Line
。 How to configure code style for a language: 如何配置语言的代码样式:
https://www.jetbrains.com/help/idea/2016.2/configuring-code-style.html https://www.jetbrains.com/help/idea/2016.2/configuring-code-style.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.