单行匿名类的IntelliJ IDEA包装设置 [英] IntelliJ IDEA wrapping settings for one-line anonymous class

查看:67
本文介绍了单行匿名类的IntelliJ IDEA包装设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置IntelliJ IDEA以防止在自动重新格式化期间将声明在一行上的匿名类拆分成几行( CTRL + ALT + L )?

How to setup IntelliJ IDEA to prevent the splitting of an anonymous class, declared on one line, into several lines during auto-reformating (CTRL+ALT+L)?

例如,为防止拆分

x = foo(new Boo() {});

分为两行:

x = foo(new Boo() {

});

推荐答案

"File" [menu]/"Settings"/"Code Style"/"Alignment and Braces":
   ==>  "Keep when Reformatting" Field Set:
          Check: "Simple methods in one line"
          Check: "Simple blocks in one line"

这篇关于单行匿名类的IntelliJ IDEA包装设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆