可以settings-general-auto import-java项,勾选Add unambiguous imports on the
fly、optimize imports on the
fly,在当前项目下会快速添加明确的导入、自动清除无效的import,而且这个是随时自动清除的。Add unambiguous imports on the fly:快速添加明确的导入。
Optimize imports on the fly:快速优化导入,优化的意思即自动帮助删除无用的导入。
IDEA 自动删除类中无用的import包
最新推荐文章于 2025-04-21 09:05:11 发布