【问题标题】:Why google-java-format separates java.XYZ imports?为什么 google-java-format 将 java.XYZ 导入分开?
【发布时间】:2020-04-20 15:00:10
【问题描述】:

根据文档:google-java-format 是一个重新格式化 Java 源代码以符合 Google Java 风格的程序。

我检查了Google Java Style,它没有说明对 java.XYZ 导入的特殊处理。

就我而言,我得到:

import org.ABC;
import lombok.DFG;

import java.time.ZonedDateTime;

顺便说一句,我使用的是 IntelliJ 2020.1(它会是嫌疑人吗(像往常一样)?)

我错过了什么?

【问题讨论】:

    标签: java intellij-idea coding-style


    【解决方案1】:

    一如既往地阅读docs in full更好:

    The import ordering is not handled by this plugin, unfortunately.
    To fix the import order, download the IntelliJ Java Google Style file and import it into File→Settings→Editor→Code Style.
    

    【讨论】:

      猜你喜欢
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 2016-04-03
      • 1970-01-01
      • 2014-05-13
      • 1970-01-01
      • 2018-11-30
      • 1970-01-01
      相关资源
      最近更新 更多