Auto Import
for Windows and Linux
for macOS
Ctrl+Alt+S
XML
Show import pop-up | Automatically display an import pop-up dialog box when typing the name of an unbound namespace. |
Java
Insert imports on paste | Use this drop-down list to define how IntelliJ IDEA will insert imports for pasted blocks of code, if they contain references to classes that are not imported into the target class. The available options are:
|
Show import pop-up | Automatically display import pop-up dialog box when typing the name of a symbol that lacks import statement. |
Optimize imports on the fly | Select this check box to have have the Optimize Imports operation automatically performed for your files. |
Add unambiguous imports on the fly | Select this check box to have IntelliJ IDEA automatically add imports that can be added without user intervention. |
Exclude from Import and Completion | In this area, create a list of packages and classes that should not be automatically included in the import statements. Note that you can exclude packages and classes both on the project level and on the IDE level. This can be done in the cells of the Scope column: ![]() Use: |
TypeScript
Show import pop-up | Automatically display import pop-up dialog box when typing the name of a symbol that lacks import statement. |
JSP
Add unambiguous imports on-the-fly | Select this check box to have IntelliJ IDEA automatically add imports that can be added without user intervention. |
Scala
Insert imports on page | Use this drop-down list to define how IntelliJ IDEA will insert imports for pasted blocks of code, if they contain references to classes that are not imported into the target class. The available options are:
|
To disable import import pop-up, use Java settings | Refer to the same options in the settings for Java. |
Add unambiguous imports on the fly | Select this check box to have IntelliJ IDEA automatically add imports that can be added without user intervention. |
Optimize imports on the fly | Select this check box to have the Optimize Imports operation automatically performed for your files. |
PHP
Enable auto-import in file scope | Select this check box to have IntelliJ IDEA automatically import PHP namespaces, add use statements, and complete short class names on the fly, when you are typing in a class or file that does not belong to any specific namespace. By default, the check box is cleared. |
Enable auto-import in namespace scope | Select this check box to have IntelliJ IDEA automatically import PHP namespaces, add use statements, and complete short class names on the fly when you are typing in a class or file that belongs to a certain namespace. The check box is selected by default. |
Enable auto-import from global space | When this check box is selected, IntelliJ IDEA automatically adds |
Prepend functions and constants from the global space with '\' | The check box is available only when the Enable auto-import from global space is cleared. When the check box is selected, IntelliJ IDEA automatically prepends called functions and referenced constants from the global namespace with a backslash. When the check box is cleared, no backslashes are added. |
To keep your code easy to read and increase productivity by avoiding additional loops during name resolution, select either the Enable auto-import from global space or the Prepend functions and constants from the global space with '\' checkbox. See PHP name resolution rules for more details. |