Code completion (IntelliSense)
ReSharper complements and extends Visual Studio's native code completion (IntelliSense) with more advanced capabilities. For example, it narrows down the list of suggestions based on your typing, automatically imports selected types and extension methods, adds parentheses when completing method names, suggests variable and field names depending on their types, and more.
To get you familiar with ReSharper's code completion features, here are some implementation basics:
By default, ReSharper replaces Visual Studio's native's IntelliSense with its own features.
The suggestion list of Automatic completion appears as soon as you start typing a new identifier. The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Control+Space.
If necessary, you can always return to the Visual Studio's native's IntelliSense. To do so, select Visual Studio on the page of ReSharper options (Alt+R, O).
Two other completion commands, Smart completion Control+Shift+Space and Import Symbol Completion Control+Alt+Space, which are available always, independently of the selected option for standard completion commands, apply advanced algorithms to add more items to the suggestion list.
All of ReSharper's completion shortcuts can be pressed several times in succession. In this case, ReSharper adds even more suggestions to the completion list. For more information, see Double Completion.
By default, all ReSharper's completion features support CamelHumps, that is you can type the initial letters of compound name parts and the name will appear in the list of suggestions.
If necessary, you can disable CamelHumps by clearing the Match middle of identifiers checkbox on the page of ReSharper options (Alt+R, O).
When you use code completion over existing code items, you can either insert the selected completion suggestion before the existing item by pressing Enter or replace the existing identifier with the selected suggestion by pressing Tab. If necessary, you can change the default shortcuts on the page of ReSharper options (Alt+R, O).
You may want some types or namespaces not to be suggested, for example, if you have something similar to a system type in your solution, say
MyFramework.MyCollections.List, but you are not actually using it. To exclude such items from the suggestions, add them to the Exclude from import and completion list on the page of ReSharper options (Alt+R, O).
The format of the entries is
*Fully.Qualified.Name.Suffix. Generic types are specified as
When you select items in completion lists using keyboard, the selection will jump to the first item after the last item and vice versa. You can disable this behavior by clearing Loop selection around ends of a list on the page of ReSharper options (Alt+R, O).
When choosing a method call from the completion list, by default ReSharper automatically inserts a pair of parentheses
( )and sets the caret between them. You can change this behavior with the Automatically insert parenthesis after completion option on the page of ReSharper options (Alt+R, O).
Here are some other general points that show how ReSharper's code completion features are different from Visual Studio's native IntelliSense:
As you type, the list of completion suggestions is narrowed down to match your input. If necessary, you can turn this off by clearing the corresponding checkbox on thepage of ReSharper options . You can also specify the initial size of the completion list using the corresponding option on the page of ReSharper options .
Immediate members of a type are emphasized, as opposed to inherited members.
When you select a suggestion in the list, ReSharper displays its summary taken from the XML documentation. You can disable this by clearing the Show summary checkbox on the page of ReSharper options .
By default, all overloads of a method are shown as a single method name without a signature in the suggestion list. When you select it, the list of overloads, if any, appears in a popup where you can study them. To switch between signatures in the popup, you can press Control+P. If you want to see each signature of an overloaded method separately in the completion list, select Show member signatures on the page of ReSharper options .
Where applicable, Code Completion suggests indexers along with type members, and corrects expression syntax accordingly if an indexer is selected.
Custom icons for parameters and local variables are provided to distinguish them from fields.
When you declare a field, method parameter, or local variable, ReSharper suggests a list of possible names to choose from taking into account other names in the current context and your naming rules.
In this section:
- Automatic completion
- Basic completion
- Smart completion
- Import Symbol Completion
- Double Completion
- Generative completion
- Using Filters in Code Completion