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.
Availability of context actions for a code position is designated by one of the following icons to the left of the current line:
- for code editing actions.
- for refactoring actions.
- for navigation actions.
Context actions can also be available in the same drop-down lists as
For example, context actions for C# can help you:
- Change member visibility from public to private or protected.
- Apply a contextually available
- 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
ArrayListwith a generic
To examine the full list of context actions available for a particular language, see:
List of Context Actions for C#
List of Context Actions for VB.NET
List of Context Actions for XML
List of Context Actions for ASP.NET
- 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 (a yellow or red light bulb).
- Press Alt+Enter.
A drop-down list that includes all available context actions (and possibly quick-fixes) will be displayed. In this case, the drop-down list provides one quick-fix and two context actions:
For guidelines on how to customize lists of context actions that you would like ReSharper to suggest,
To learn how to view drop-down lists of available context actions and apply them, see