Skip to content

Repo sync for protected branch #10469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions docs/ide/quick-actions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Quick Actions, light bulbs, and screwdrivers
description: Use a single Quick Action in Visual Studio to refactor, generate, or modify your C#, C++, or Visual Basic code files to apply updates and fixes or generate code.
ms.date: 08/14/2024
ms.date: 11/01/2024
ms.topic: concept-article
author: Mikejo5000
ms.author: mikejo
Expand Down Expand Up @@ -37,6 +37,22 @@ Visual Studio uses several icons to indicate when Quick Actions are available. T

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 ![light bulb icon](media/light-bulb-icon.png), screwdriver ![screwdriver icon](media/screwdriver-icon.png), and error light bulb ![error light bulb icon](media/error-light-bulb-icon.png):

- Move your mouse over your code and notice any Quick Action icons:

:::image type="content" source="../ide/media/vs2022-lightbulb-hover.png" border="false" alt-text="Screenshot that shows the basic Quick Action recommendation and light bulb icon in Visual Studio.":::

- Move the insertion cursor (|) into a line of code, and check for Quick Action icons in the left margin of the code editor.

You can also manually check for any available Quick Actions:

- Right-click a line of code and choose **Quick Actions and Refactorings** for a list of available Quick Actions and refactoring options.

- Select Ctrl + period (.) anywhere on a line.

## Apply recommendations to improve code

When Quick Actions are available, you can select the light bulb ![light bulb icon](media/light-bulb-icon.png) or screwdriver ![screwdriver icon](media/screwdriver-icon.png) icon next to the applicable code.
Expand All @@ -60,17 +76,6 @@ If there's an error in your code, and Visual Studio has a recommended fix, you s
> [!TIP]
> You can turn off some of the code fix Quick Actions. For more informatio, see [Disable source code analysis for .NET](../code-quality/disable-code-analysis.md).

## Find available actions

You can check your code for available Quick Actions in Visual Studio by scanning for the light bulb ![light bulb icon](media/light-bulb-icon.png), screwdriver ![screwdriver icon](media/screwdriver-icon.png), and error light bulb ![error light bulb icon](media/error-light-bulb-icon.png):

- Move your mouse over your code and notice any Quick Action icons:

:::image type="content" source="../ide/media/vs2022-lightbulb-hover.png" border="false" alt-text="Screenshot that shows the basic Quick Action recommendation and light bulb icon in Visual Studio.":::

- Move the insertion cursor (|) into a line of code, and check for Quick Action icons in the left margin of the code editor.

- Select Ctrl + period (.) anywhere on a line for a list of available Quick Actions and refactoring options.

## Related content

Expand Down