How to let java file to display some obvious warns info which has unused import .

Answered

As the title suggest, i want display a warn info of java file and package. The picture below is eclipse's implement. Could idea display some info like it? Now I only open each java file to fond unused import.

5 comments
Comment actions Permalink

You can use `Code -> Optimize Imports` to remove the unused imports in the project. Why would you like to see see them in the project structure?

0
Comment actions Permalink

  Thanks for your answer. I have choice this setting. But found that sometimes i forget to format my code .the unused import will not be remove. And maybe others colleagues haven't choice this setting, he will push unused import to git. So i want see them in the project structure.

0
Comment actions Permalink

Some people may choose to ignore the warnings..... I suggest you use the Save-Actions plugin in your team. It can remove the unused imports automatically.

 
1
Comment actions Permalink

@Liu Pei Pei thanks, I will try your suggest.

0
Comment actions Permalink

Have you tried Preferences | Editor | General | Auto Import | Optimize imports on the fly?

1

Please sign in to leave a comment.