Auto Import
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:
If you skip an import suggested in the Ask mode or choose the None mode, the non-imported classes will be red-highlighted and an import pop-up window will appear to help you create import statements using the Alt+Enter keyboard shortcut. |
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:
IntelliJ IDEA allows using an asterisk wildcard to define the classes/packages to be excluded. |
TypeScript/JavaScript
Add ES6 imports automatically Autoimport in ES6 works only when the ECMAScript 6 language level is chosen on the JavaScript page ( for Windows and Linux or for macOS). |
|
Add TypeScript imports automatically |
|
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
This table is only available when Scala plugin is downloaded and installed. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins. | |
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:
If you skip an import suggested in the Ask mode or choose the None mode, the non-imported classes will be red-highlighted and an import pop-up window will appear to help you create import statements using the Alt+Enter keyboard shortcut. |
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
This table is only available when PHP plugin is downloaded and installed. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins. | |
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. |