问题
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