Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Quick Actions in Visual Studio let you easily refactor, generate, or otherwise modify your code with a single action. Quick Actions are available for C#, C++, and Visual Basic code files. Some actions are specific to a language, and others apply to all languages.
Quick Actions can be used to:
- Apply a code fix for a code analyzer rule violation
- Suppress a code analyzer rule violation or configure its severity
- Apply a refactoring, such as inline for a temporary variable
- Generate code, such as to introduce a local variable
Understand Quick Action icons
Visual Studio uses several icons to indicate when Quick Actions are available. The icon type indicates whether the Quick Action is a recommendation or required fix, including refactoring:
Screwdriver
: Suggested action to improve your code.Yellow light bulb
: Recommended action to address noncritical issues with your code.Error light bulb
: Critical action to fix an error in your code, or apply necessary refactoring.
For any language, third parties can provide custom diagnostics and suggestions, such as part of an SDK. Visual Studio shows light bulbs based on those rules.
Find available actions
You can check your code for available Quick Actions in Visual Studio by scanning for the light bulb