使用 Intellij IDEA 进行代码样式设计
假设我的代码如下所示:
public abstract class
ResourceDownloaderBaseImpl
implements ResourceDownloader {
public Object
getProperty(
String name)
throws ResourceDownloaderException {
....
还有其他一些代码。当我在 Intellij IDEA 中按 Ctrl+Alt+L 时,它不会将其格式化为单行,如下所示:
public abstract class ResourceDownloaderBaseImpl implements ResourceDownloader {
public Object getProperty(String name) throws ResourceDownloaderException {
...
有没有办法调整代码重新格式化功能,以便将签名放在一行上?
Let's say I have code that looks like this:
public abstract class
ResourceDownloaderBaseImpl
implements ResourceDownloader {
public Object
getProperty(
String name)
throws ResourceDownloaderException {
....
And bunch of other. When I press Ctrl+Alt+L in Intellij IDEA it does not format it into single line like this:
public abstract class ResourceDownloaderBaseImpl implements ResourceDownloader {
public Object getProperty(String name) throws ResourceDownloaderException {
...
Is there a way to adjust the code reformating feature so it puts the signatures onto a single line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
项目设置
中的代码样式
部分,您可以在其中指定几乎所有内容。更准确地说,查看
代码样式
-包裹和支撑
并查看重新格式化期间保留换行符
是否已打开Check out the
Code Style
section in yourProject Settings
where you can specify almost everything.More precisely, look under
Code Style
-Wrapping and bracing
and see whetherkeep line breaks during reformatting
is switched on