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:

    Image 1:
  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:

    Image 2: