【问题标题】:Code Styling with Intellij IDEA使用 Intellij IDEA 进行代码样式设置
【发布时间】:2011-12-04 14:35:15
【问题描述】:

假设我的代码如下所示:

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 {
    ...

有没有办法调整代码重新格式化功能,以便将签名放在一行上?

【问题讨论】:

    标签: java intellij-idea coding-style reformatting


    【解决方案1】:

    查看Project Settings 中的Code Style 部分,您可以在其中指定几乎所有内容。 更准确地说,查看Code Style - Wrapping and bracing 下的keep line breaks during reformatting 是否已打开

    【讨论】:

      猜你喜欢
      • 2016-07-25
      • 2013-08-22
      • 1970-01-01
      • 2013-10-29
      • 1970-01-01
      • 2018-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多