Auto import

Last modified: 19 March 2022

If you use a type, an interface, a method, or a function that you haven't imported yet, the IDE shows you a tooltip prompting to add a missing import statement so that you don't have to add it manually. Press Alt+Enter to accept the suggestion.

If there's more than one possible source of import, pressing Alt+Enter will open the list of suggestions.

https://resources.jetbrains.com/help/img/idea/2021.3/go_auto_import.png
Gif