IntelliJ IDEA 2017.3 Help

Auto Import

XML

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:

All - select this option to have IntelliJ IDEA automatically add import statements for all classes that are found in the pasted block of code and are not imported in the current class yet.

Ask - if this option is selected, when pasting code blocks, IntelliJ IDEA will open a dialog box, where you can choose the desired imports.

None - select this option to suppress import.

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 checkbox to have have the Optimize Imports operation automatically performed for your files.

Add unambiguous imports on the fly

Select this checkbox 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:

(Alt+Insert) to enter the name of the class/package to be excluded from import and completion.

(Alt+Delete) to remove the selected item from the list.

IntelliJ IDEA allows using an asterisk wildcard to define the classes/packages to be excluded.

TypeScript/JavaScript

Add ES6 imports automatically

Auto import in ES6 works only when the ECMAScript 6 language level is chosen on the JavaScript page (File | Settings | Languages and Frameworks | JavaScript for Windows and Linux or IntelliJ IDEA | Preferences | Languages and Frameworks | JavaScript for macOS).

If this checkbox is selected, IntelliJ IDEA automatically inserts an import statement in JavaScript code when you complete a symbol exported using ES6 exports in another project file:

When the checkbox is cleared, on pressing Alt+Enter IntelliJ IDEA shows a pop-up that suggests to import the completed symbol:

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:

All - select this option to have IntelliJ IDEA automatically add import statements for all classes that are found in the pasted block of code and are not imported in the current class yet.

Ask - if this option is selected, when pasting code blocks, IntelliJ IDEA will open a dialog box, where you can choose the desired imports.

None - select this option to suppress import.

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 checkbox to have IntelliJ IDEA automatically add imports that can be added without user intervention.

Optimize imports on the fly

Select this checkbox to have the Optimize Imports operation automatically performed for your files.

Select this checkbox 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 checkbox is cleared.

Enable auto-import in namespace scope

Select this checkbox 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 checkbox is selected by default.

Enable auto-import from global space

When this checkbox is selected, IntelliJ IDEA automatically adds use statements for classes, functions, and constants from the global namespace, for example, Exception, is_array(), strlen() etc. When this checkbox is cleared, no use statement for such classes, functions, and constants is added. By default, the referenced symbol is not prepended with a backslash. To have a backslash inserted automatically, select the Prepend functions and constants from the global space with '\' checkbox.

Prepend functions and constants from the global space with '\'

The checkbox is available only when the Enable auto-import from global space is cleared. When the checkbox is selected, IntelliJ IDEA automatically prepends called functions and referenced constants from the global namespace with a backslash. When the checkbox 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.