ReSharper 8.0 Web Help

Although code completion is one of the most powerful and useful features, in some cases it can get in your way. For example, when you are typing something that is missing from code completion list or when not the desired item is selected. Since ReSharper 7.0 you can control the behavior of code completion. So you can define typing which symbols should not invoke insertion of selected item in code completion list.

To define default behavior for 'Enter' and 'Tab' keys
  1. On the main menu, choose ReSharper | Options. The Options dialog box opens.
  2. On the left pane of the dialog, click IntelliSense | Completing Characters.
  3. On the right pane in Enter Key and Tab Key lists, click
    • Inserts - to insert suggested items from the code completion list without replacing the text after the caret on pressing the corresponding key
    • Replaces - to replaces the text after the caret with suggested items from the code completion list on pressing the corresponding key
  4. Click Save or Save To to apply changes.
To define symbols that do not invoke code completion
  1. On the main menu, choose ReSharper | Options. The Options dialog box opens.
  2. On the left pane of the dialog, click IntelliSense | Completing Characters.
  3. On the right pane, you can define whether to complete on space or not. To do that, select or clear check boxes for C#, VB.NET or any other language.
  4. To define symbols that should not invoke code completion, type them in text boxes for C#, VB.NET or any other language.
  5. Click Save or Save To to apply changes.
To define autopopup behavior for a particular language or context
  1. On the main menu, choose ReSharper | Options. The Options dialog box opens.
  2. On the left pane of the dialog, click IntelliSense | Autopopup.
  3. You can define code completion behavior for all languages or concentrate on a desired one. So, on the right pane of the Options dialog box, click the appropriate tab, then look through the available contexts that are displayed in the table and specify the behavior clicking the value in the drop-down list.

    Note

    Pay attention, that the Enable Automatic IntelliSense Popup check box should be selected in order to modify other options on the Autopopup pane.
  4. Click Save or Save To to apply changes.

For example, you can define the behavior after typing a dot in C# files.

Configuring_Code_Completion__autopopup_pane

At the examples below you can see the effect of each setting.

Configuring_Code_Completion__autopopup_behaviour

Code Completion is a part of ReSharper IntelliSense. When you change settings related to IntelliSense, it may affect completion behavior. To be sure that completion list is generated and displayed by ReSharper, check that ReSharper IntelliSense is chosen.

To choose ReSharper IntelliSense
  1. On the main menu, choose ReSharper | Options. The Options dialog box opens.
  2. On the left pane of the dialog box, choose IntelliSense | General.
  3. On the right pane, click ReSharper.
  4. Click Save or Save To to apply changes.

You can fine tune completion behavior and appearance. To do that, open the Options dialog box and find Completion Behavior and Completion Appearance pages. Using the settings on these pages you can, for example, change the length of completion list or exclude keywords from the list, etc. For more information, see Completion Appearance and Completion Behavior.

You can also define whether import completion items should be included in basic and/or automatic completion lists.

To include import completion items
  1. On the main menu, choose ReSharper | Options. The Options dialog box opens.
  2. On the left pane of the dialog box, click Completion Behavior.
  3. On the right pane of the dialog box, select Show import items in basic completion and/or Show import items in automatic completion check boxes depending on your needs.
  4. Click Save or Save To to apply changes.

When you invoke double import completion, ReSharper adds corresponding references in your project. If you do not want to be asked each time before a reference is added, you can clear the Show confirmation dialog before adding references check box.