PhpStorm 2016.2 Help

Auto Import

File | Settings | Editor | General | Auto Import for Windows and Linux
PhpStorm | Preferences | Editor | General | Auto Import for OS X
Ctrl+Alt+S
settings


XML

Show import pop-upAutomatically display an import pop-up dialog box when typing the name of an unbound namespace.

TypeScript

Show import pop-upAutomatically display import pop-up dialog box when typing the name of a symbol that lacks import statement.
Merge imports for symbols from the same module
Use paths relative to tsconfig.jsonWhen this check box is selected, PhpStorm calculates import paths using the tsconfig.json file as the root. When this check box is cleared, PhpStorm calculates import paths relative to the project root.

For example, if your project is structured as follows:

ws_ts_import_example.png

With the check box selected, PhpStorm generates the following import statement:

import {ClassName} from 'directory_2/file_2'

If the check box is cleared, the following import statement is generated:

import {ClassName} from '../directory_2/file_2'

PHP

Enable auto-import in file scopeSelect this check box to have PhpStorm 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 scopeSelect this check box to have PhpStorm 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.

See Also

Last modified: 2 September 2016