When you reference a type that has not been imported, ReSharper helps you locate this type and add it to the list of namespace import directives. The new directive is added to the list, but the caret stays in the current position, and your editing session is not interrupted.
It is important to note that "using" directives are added in alphabetical order: all System. namespaces go first, sorted alphabetically by the second word after dot; all the rest namespaces go next, in alphabetical
order.
Depending on your
- 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:
- 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:
For guidelines on how to import a type with a quick-fix, see
