ReSharper 2017.2 Help

Double Completion

All ReSharper's completion shortcuts can be pressed several times in succession. In this case, ReSharper adds even more suggestions to the completion list.

The completion algorithm name appears at the bottom of the suggestions list. The new suggestions are marked with green vertical lines, so you can easily discover them. If necessary, you can turn off these helpers by clearing the Show completion type and Highlight new items check-boxes on the Environment | IntelliSense | Completion Appearance page of ReSharper options.

Double basic completion

When you invoke Basic Completion (Ctrl+Space) twice, ReSharper adds a number of new suggestions to the completion list.

Non-public members for the current symbol and its base types are added to the completion list.

Double basic completion. Using non-public members

Note that ReSharper still highlights the public member, suggesting to use it because the private member will produce non-compilable code. However, if you decide to use the private member it is very easy to make it public: just press Alt+Enter over the highlighted error and choose Make method public quick-fix.

If you check an object for a compatibility with a derived type, ReSharper adds members of this derived type and all intermediate types in the inheritance hierarchy to the completion list. If you choose one of them, ReSharper will automatically cast the variable to the this type:

Members of derived classes in the ReSharper completion list

You can also cast the sender argument in an event handler to the desired parent control type and access its members.

Casting the 'sender' argument to a desired type using ReSharper's code completion

Double import completion

When you invoke Import Symbol Completion (Ctrl+Alt+Space) twice, ReSharper adds public types and extension methods from non-references modules to the completion list. ReSharper looks for public types and extension methods in other projects within your solution as well as in all compiled assemblies that are referenced in other projects of your solution. The non-referenced modules are displayed in red:

Coding Assistance Code Completion Double double import completion

If you choose an item from a non-referenced module ReSharper adds the missing references automatically. By default ReSharper displays a confirmation dialog for each new reference. If necessary, you can disable it by clearing the Show confirmation dialog before adding reference check box on the Environment | IntelliSense | Completion Behavior page of ReSharper options.

Double smart completion

When you invoke Smart Completion (Ctrl+Shift+Space) twice, ReSharper adds call chains that have return values of the expected data type.

Call chains in the ReSharper's completion list
You can press Ctrl+Shift+Space multiple times to extend the list with more complicated call chains. The more times you press, the longer call chains become.

ReSharper can also generate suggestions of call chains that return the expected type based on the patterns used in your solution. To enable this, select Enable smart call chains on the Environment | IntelliSense | Completion Behavior page of ReSharper options.
Note that to use this feature, Solution-Wide Analysis should be enabled. Also, on large solutions it can slow down the double completion algorithm.

By default, ReSharper takes into account only instance methods and their return values. If necessary, you can also include extension methods to the list of suggestion. To do so, select Show extension methods in double smart completion on the Environment | IntelliSense | Completion Behavior page of ReSharper options.
Note that on large solutions, this can slow down the double completion algorithm.

This feature is supported in the following languages and technologies:

Language: C# Language: VB.NET Language: C++ Language: HTML Language: ASP.NET Language: Razor Language: JavaScript Language: TypeScript Language: CSS Language: XML Language: XAML Language: Resx Language: Build Scripts Language: Protobuf Language: JSON
Feature is available Feature is available Feature is not available Feature is not available Feature is available Feature is available Feature is available Feature is available Feature is not available Feature is not available Feature is available Feature is not available Feature is not available Feature is not available Feature is not available

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

Last modified: 14 December 2017

See Also