ReSharper 8.0 Web Help

Context actions are shortcuts to different ReSharper features that are displayed right in the code editor when you work with C#, VB.NET, XML, or ASP.NET code.

Context actions suggest executing minor code transformations, refactorings, or navigation actions.

Whereas quick-fixes are intended to fix errors and less serious code issues, context actions just give an overview of ReSharper features that can be applied at a certain code position. Whether you use the suggested context actions or not is entirely up to you.

Availability of context actions for a code position is designated by one of the following icons to the left of the current line:

  • Coding_Assistance__Context_Actions__icon_editing for code editing actions
  • Coding_Assistance__Context_Actions__icon_refactor for refactoring actions
  • Coding_Assistance__Context_Actions__icon_navigate for navigation actions

Context actions can also be available in the same drop-down lists as quick-fixes. If that's the case, a quick-fix icon is displayed to the left of the code line.

For example, context actions for C# can help you:

  • Change member visibility from public to private or protected.
  • Apply a contextually available refactoring.
  • Convert an anonymous method to a lambda expression, or vice versa.
  • Convert an implicit interface implementation to an explicit interface implementation, or vice versa.
  • Create a derived type.
  • Create a method overload without a parameter.
  • Initialize an auto-property from a constructor parameter.
  • Replace an ArrayList with a generic List<T>.

To examine the full list of context actions available for a particular language, see:

To display the list of available context actions in a code position
  • Click an icon to the left of the current code line that shows availability of context actions. This could be either one of context action-specific icons listed above or a quick-fix icon.
  • Press Alt+Enter. A drop-down list that includes all available context actions and quick-fixes is displayed. In this case, the drop-down list provides one particular context action.

    Coding_Assistance__Context_Actions__drop-down_list

For guidelines on how to customize lists of context actions that you would like ReSharper to suggest, see Configuring Context Actions.

To learn how to view drop-down lists of available context actions and apply them, see Applying Context Actions.


This feature is supported in the following languages/technologies:

C# VB.NET HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available

Tip

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