How to delete all unused imports from current project in Intellij Idea

隐身守侯 提交于 2020-12-28 13:25:27

问题


I have been using Intellij Idea for quite some time now. I have a few questions though. Is there a way to delete all unused imports from all files in the current project?

I know that I can choose menu item Code > Optimize Imports (CTRL + ALT + O) to organize imports in individual files but since the application that I am working on has hundreds of files, this process does not make any sense. If there is no way of doing this, can I create a macro for this? If so, how do I do it?


回答1:


Click the project folder, then enter CTRL + ALT + O. It will handle all files under the folder:



来源:https://stackoverflow.com/questions/51833539/how-to-delete-all-unused-imports-from-current-project-in-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!