Chr*_*son 9 java intellij-idea
或多或少正是标题所说的.当我cmd+时f,它根据项目的设置格式化代码.其中一个设置是正确的保证金.问题是它还会拆分字符串文字以避免过度运行边距.所以这:
stringBldr.append("some text that's more than 80 characters");
Run Code Online (Sandbox Code Playgroud)
变成这样:
stringBldr.append("some text that's more " +
"than 80 characters");
Run Code Online (Sandbox Code Playgroud)
这完全违背StringBuilder了首先使用它的目的.在Eclipse中,我可以告诉它在格式化时忽略String文字.有没有办法在IntelliJ中执行此操作而无需手动禁用该部分的代码格式化程序(例如@formatter:off)?
尝试玩
Editor | Code Style | Java | Wrapping and Braces | Annotation with parameters - Wrap always + align when multiline
Run Code Online (Sandbox Code Playgroud)
还
Editor |Code->Style | Wrapping and Braces | Method parameters/Method call arguments'
Run Code Online (Sandbox Code Playgroud)
“如果长则包裹”或“如果长则砍掉”。
| 归档时间: |
|
| 查看次数: |
405 次 |
| 最近记录: |