实时优化 Android Studio/IntelliJ 中所有项目的导入。

huangapple go评论72阅读模式
英文:

Optimize imports on the fly for all projects in Android Studio/IntelliJ

问题

是否有一种方法可以在Android Studio/IntelliJ中为所有项目(而不仅限于“当前项目”)实时优化导入?

预期

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

观察到的情况

在实时添加不含歧义的导入 是IDE级别的设置。然而,在实时优化导入 似乎不像括号中所述的那样出现为“对于当前项目”。我通过创建一个新项目并打开设置进行了测试。如预期所示,在实时添加不含歧义的导入 被选中,而 在实时优化导入 未被选中。

当前的IntelliJ文档,自动导入,没有提供解决方案。

实时优化 Android Studio/IntelliJ 中所有项目的导入。

尝试的解决方案

在“新项目的首选项”下启用 在实时优化导入(对于当前项目)

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

实时优化 Android Studio/IntelliJ 中所有项目的导入。

实时优化 Android Studio/IntelliJ 中所有项目的导入。

这也已经被添加到了IntelliJ社区论坛

英文:

Is there a way to optimize imports on the fly for all projects, not just 'for current project' in Android Studio/IntelliJ?

Expected

Optimize imports to be enabled when opening an existing project and/or when creating new projects.

Observed

Add unambiguous imports on the fly is IDE-level settings. However, Optimize imports on the fly does not appear to be as the parenthesis state for current project. I've tested this by creating a new project and opening the settings. As expected, Add unambiguous imports on the fly is selected while Optimize imports on the fly is not selected.

The current IntelliJ documentation, Auto imports, does not provide a solution.

实时优化 Android Studio/IntelliJ 中所有项目的导入。

Attempted solution

Enable Optimize imports on the fly (for current project) under Preferences for New Projects...

This produced the same observed result above.

实时优化 Android Studio/IntelliJ 中所有项目的导入。

实时优化 Android Studio/IntelliJ 中所有项目的导入。

This has also been added to the IntelliJ community forum.

答案1

得分: 1

很遗憾,在IDEA-237002问题得到解决之前,这是不可能的。

英文:

Unfortunately, it's not possible until IDEA-237002 is fixed.

huangapple
  • 本文由 发表于 2020年4月9日 04:11:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/61109221.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定