【问题标题】:Optimize imports on the fly for all projects in Android Studio/IntelliJ为 Android Studio/IntelliJ 中的所有项目即时优化导入
【发布时间】:2020-07-21 08:50:35
【问题描述】:

有没有办法为所有项目即时优化导入,而不仅仅是 Android Studio/IntelliJ 中的“当前项目”?

预期

优化导入以在打开现有项目和/或创建新项目时启用。

观察到

Add unambiguous imports on the fly 是 IDE 级别的设置。但是,Optimize imports on the fly 似乎不是括号状态for current project。我通过创建一个新项目并打开设置对此进行了测试。正如预期的那样,Add unambiguous imports on the fly 被选中,而 Optimize imports on the fly 未被选中。

当前的 IntelliJ 文档 Auto imports 没有提供解决方案。

尝试的解决方案

新项目首选项下启用Optimize imports on the fly (for current project)...

这产生了与上述相同的观察结果。

这也已添加到IntelliJ community forum

【问题讨论】:

  • 你如何定义“所有项目”?
  • 期望的目标以及我所说的“所有项目”是在打开现有项目或创建新项目时将其作为默认设置。
  • 那么看起来检查该复选框就是您想要的。您正在查看 IDE 级别的设置,而不是特定于项目的设置。
  • Add unambiguous imports on the fly 是 IDE 级别的设置。但是,Optimize imports on the fly 似乎不是括号状态for current project。我通过创建一个新项目并打开设置对此进行了测试。正如预期的那样,Add unambiguous imports on the fly 被选中,而Optimize imports on the fly 未被选中。
  • 好吧,这是一个很奇怪的设置 UI 设计。

标签: java android android-studio kotlin intellij-idea


【解决方案1】:

感谢您的反馈,我已在 YouTrack 中提交了工单:

  • IDEA-237002 动态优化导入:允许将其设为新项目的默认设置

【讨论】:

    猜你喜欢
    • 2017-11-05
    • 2013-05-12
    • 2015-08-21
    • 2015-09-23
    • 2014-08-18
    • 2013-06-30
    • 2013-05-10
    • 2015-02-12
    • 1970-01-01
    相关资源
    最近更新 更多