To add a namespace import directive on-the-fly
  1. Start typing a name in the editor. If the name references a class that lacks a namespace import directive, the following pop-up window displays:
  2. Press Alt+Enter. If there's a single choice, the namespace will be imported right away. If there are multiple choices, a drop-down list will display where you can select a required type:
To add namespace import directives for all types
  1. Paste a block of code into the desired file.
  2. If the block of code contains types that lack namespace import directives, the following pop-up prompt displays.
  3. Press Alt+Enter or click to insert all required namespace import directives.