One trick to fix IDEA automatic import
If you are using a class that has not been imported (imported), or its For static methods or static fields, IDEA will give corresponding suggestions. Just press ⌥ (option) and press Enter to accept the suggestions. (Recommended video: java video tutorial)
But I think This is still cumbersome and not smart enough. How to do it?
Open IDEA's preferences and find Editor | General | Auto Import. Check Add unambiguous imports on the fly and Optimize imports on the fly (for current project).
After clicking "OK", the import statement will be automatically imported when copying the code.
Of course, the prerequisite is that the import statement is single and determined. If there are multiple options, IDEA will still give corresponding suggestions for you to choose manually.
Okay, you’re done! Give yourself a pat on the back.
This article comes from php Chinese website, java tutorial column, welcome to learn!
The above is the detailed content of One trick to complete IDEA automatic import (import). For more information, please follow other related articles on the PHP Chinese website!