Skip to content

Commit a015086

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/visualstudio-docs-pr (branch live)
2 parents 36ad790 + ea72bbf commit a015086

30 files changed

+459
-212
lines changed
383 KB
Loading
104 KB
Loading
Loading
Loading
Loading
Loading
Loading
679 KB
Loading

docs/debugger/view-data-values-in-data-tips-in-the-code-editor.md

Lines changed: 211 additions & 74 deletions
Large diffs are not rendered by default.

docs/ide/customize-build-and-debug-tasks-in-visual-studio.md

Lines changed: 144 additions & 101 deletions
Large diffs are not rendered by default.
Loading
Loading
Loading
Loading
97.6 KB
Loading
143 KB
Loading
125 KB
Loading
17.4 KB
Loading
Loading
38.2 KB
Loading

docs/ide/quick-actions.md

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,82 @@
11
---
22
title: Quick Actions, light bulbs, and screwdrivers
33
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.
4-
ms.date: 08/29/2022
5-
ms.topic: conceptual
4+
ms.date: 08/14/2024
5+
ms.topic: concept-article
66
author: Mikejo5000
77
ms.author: mikejo
88
manager: mijacobs
99
ms.subservice: general-ide
1010
dev_langs:
1111
- CSharp
1212
- VB
13+
14+
#customer intent: As a developer, I want to use Quick Actions in Visual Studio, so I can modify my code files to apply updates and fixes or generate code.
1315
---
16+
1417
# Quick Actions
1518

16-
Quick Actions let you easily refactor, generate, or otherwise modify code with a single action. Quick Actions are available for C#, [C++](/cpp/ide/writing-and-refactoring-code-cpp), and Visual Basic code files. Some actions are specific to a language, and others apply to all languages.
19+
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++](/cpp/ide/writing-and-refactoring-code-cpp), and Visual Basic code files. Some actions are specific to a language, and others apply to all languages.
1720

1821
Quick Actions can be used to:
1922

2023
- Apply a code fix for a [code analyzer](../code-quality/roslyn-analyzers-overview.md) rule violation
21-
2224
- [Suppress](../code-quality/use-roslyn-analyzers.md#suppress-violations) a code analyzer rule violation or [configure](../code-quality/use-roslyn-analyzers.md#set-rule-severity-from-the-light-bulb-menu) its severity
25+
- Apply a refactoring, such as [inline for a temporary variable](../ide/reference/inline-temporary-variable.md)
26+
- Generate code, such as to [introduce a local variable](../ide/reference/introduce-local-variable.md)
2327

24-
- Apply a refactoring (for example, [inline a temporary variable](../ide/reference/inline-temporary-variable.md))
28+
> [!NOTE]
29+
> This article applies to Visual Studio on Windows. For Visual Studio for Mac, see [Refactoring (Visual Studio for Mac)](/visualstudio/mac/refactoring).
2530
26-
- Generate code (for example, [introduce a local variable](../ide/reference/introduce-local-variable.md))
31+
## Understand Quick Action icons
2732

28-
> [!NOTE]
29-
> This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see [Refactoring (Visual Studio for Mac)](/visualstudio/mac/refactoring).
33+
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:
34+
35+
- **Screwdriver** ![screwdriver icon](media/screwdriver-icon.png): Suggested action to improve your code.
36+
37+
- **Yellow light bulb** ![light bulb icon](media/light-bulb-icon.png): Recommended action to address noncritical issues with your code.
3038

31-
Quick Actions can be applied by using the light bulb ![light bulb icon](media/light-bulb-icon.png) or screwdriver ![screwdriver icon](media/screwdriver-icon.png) icons, or by pressing **Ctrl**+**.** when your cursor is on a line of code for which an action is available. You'll see an error light bulb ![error light bulb icon](media/error-light-bulb-icon.png) if there's a red squiggle indicating an error and Visual Studio has a fix available for that error.
39+
- **Error light bulb** ![error light bulb icon](media/error-light-bulb-icon.png): Critical action to fix an error in your code, or apply necessary refactoring.
3240

33-
For any language, third parties can provide custom diagnostics and suggestions, for example as part of an SDK, and Visual Studio light bulbs appear based on those rules.
41+
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.
3442

35-
## Icons
43+
## Apply recommendations to improve code
3644

37-
The icon that appears when a Quick Action is available gives an indication of the type of fix or refactoring that's available. The *screwdriver* ![screwdriver icon](media/screwdriver-icon.png) icon indicates just that there are actions available to change the code, but you shouldn't necessarily use them. The *yellow light bulb* ![light bulb icon](media/light-bulb-icon.png) icon indicates there are actions available that you *should* do to improve your code. The *error light bulb* ![error light bulb icon](media/error-light-bulb-icon.png) icon indicates there's an action available that fixes an error in your code.
45+
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.
3846

39-
## To see a light bulb or screwdriver
47+
- To see the available improvements, select the Down arrow next to the icon or use the **Show potential fixes** link.
4048

41-
If a fix is available, light bulbs appear:
49+
:::image type="content" source="../ide/media/vs2022-lightbulb-hover-expanded.png" border="false" alt-text="Screenshot that shows the Quick Action recommendation details with the light bulb icon in Visual Studio.":::
4250

43-
- When you hover the mouse at the location of an error
51+
- To apply the recommended change to your code, select the icon. You can also select Ctrl + period (.) when your cursor is on a line of code that shows an available action.
4452

45-
![Light bulb with mouse hovering](../ide/media/vs2015_lightbulb_hover.png)
53+
## Apply actions to fix errors
4654

47-
- In the left margin of the editor when you move the caret (cursor) into the applicable line of code
55+
If there's an error in your code, and Visual Studio has a recommended fix, you see a red squiggle under the code with the error. The error light bulb ![error light bulb icon](media/error-light-bulb-icon.png) icon also displays next to the marked code.
4856

49-
You can also press **Ctrl**+**.** anywhere on a line to see a list of available Quick Actions and refactorings.
57+
- To see the available fixes, select the Down arrow next to the icon or use the **Show potential fixes** link.
5058

51-
To see potential fixes, select either the down arrow next to the light bulb or the **Show potential fixes** link. A list of available Quick Actions is displayed.
59+
:::image type="content" source="../ide/media/vs2022-error-lightbulb-hover.png" border="false" alt-text="Screenshot that shows the Quick Action potential fix and error light bulb icon in Visual Studio.":::
5260

53-
![Light bulb expanded](../ide/media/vs2015_lightbulb_hover_expanded.png)
61+
- To apply the recommended change to your code, select the icon. You can also select Ctrl + period (.) when your cursor is on a line of code that shows an available action.
5462

5563
> [!TIP]
56-
> To learn how to turn off some of the code fix Quick Actions, see [Disable source code analysis for .NET](../code-quality/disable-code-analysis.md).
64+
> 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).
65+
66+
## Find available actions
67+
68+
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):
69+
70+
- Move your mouse over your code and notice any Quick Action icons:
71+
72+
:::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.":::
73+
74+
- Move the insertion cursor (|) into a line of code, and check for Quick Action icons in the left margin of the code editor.
75+
76+
- Select Ctrl + period (.) anywhere on a line for a list of available Quick Actions and refactoring options.
5777

5878
## Related content
5979

6080
- [Common Quick Actions](../ide/common-quick-actions.md)
6181
- [Code styles and Quick Actions](../ide/code-styles-and-code-cleanup.md)
6282
- [Visual Studio IntelliCode](/visualstudio/intellicode/intellicode-visual-studio)
63-
- [Write and refactor code (C++)](/cpp/ide/writing-and-refactoring-code-cpp)

docs/profiling/cpu-usage.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: CPU profiling in the Performance Profiler
33
description: Learn about the CPU profiler performance tool, which shows the CPU time and percentage spent executing code in C++, C#, Visual Basic, and JavaScript apps.
4-
ms.date: 07/25/2024
4+
ms.date: 08/14/2024
55
ms.topic: how-to
66
ms.custom: "profiling-seo"
77
author: mikejo5000
@@ -12,7 +12,7 @@ ms.subservice: debug-diagnostics
1212

1313
# Analyze performance by using CPU profiling in the Performance Profiler (C#, Visual Basic, C++, F#)
1414

15-
A good way to start investigating performance issues in your app is to understand its CPU utilization using a CPU profiler. The **CPU Usage** performance tool shows the CPU time and percentage spent executing code in C++, C#/Visual Basic.
15+
A good way to start investigating performance issues in your app is to understand its CPU utilization using a CPU profiler. The **CPU Usage** performance tool shows the CPU active computation time and percentage spent executing code in C++, C#/Visual Basic.
1616

1717
The CPU Usage tool can help you:
1818

@@ -81,13 +81,15 @@ Usually, the local machine best replicates installed app execution. To collect d
8181

8282
|Name|Description|
8383
|-|-|
84-
|**Total CPU [unit, %]**|![Total % data equation](../profiling/media/cpu_use_wt_totalpercentequation.png "CPU_USE_WT_TotalPercentEquation")<br /><br /> The milliseconds and CPU percentage used by calls to the function, and functions called by the function, in the selected time range. This is different from the **CPU Utilization** timeline graph, which compares the total CPU activity in a time range to the total available CPU.|
85-
|**Self CPU [unit, %]**|![Self % equation](../profiling/media/cpu_use_wt_selflpercentequation.png "CPU_USE_WT_SelflPercentEquation")<br /><br /> The milliseconds and CPU percentage used by calls to the function in the selected time range, excluding functions called by the function.|
84+
|**Total CPU [unit, %]**|![Total % data equation](../profiling/media/cpu_use_wt_totalpercentequation.png "CPU_USE_WT_TotalPercentEquation")<br /><br /> The milliseconds of CPU computation time and the CPU percentage used by calls to the function, and functions called by the function, in the selected time range. This is different from the **CPU Utilization** timeline graph, which compares the total CPU activity in a time range to the total available CPU.|
85+
|**Self CPU [unit, %]**|![Self % equation](../profiling/media/cpu_use_wt_selflpercentequation.png "CPU_USE_WT_SelflPercentEquation")<br /><br /> The milliseconds of CPU computation time and the CPU percentage used by calls to the function in the selected time range, excluding functions called by the function.|
8686
|**Module**|In some views, the Module column is shown, which shows the name of the module containing the function.|
8787

8888
::: moniker range=">=vs-2022"
8989
## Analyze CPU insights
9090

91+
If any insights show up in the **Top Insights** section, use the provided link to get more information about the issue identified. In addition, if you are using Copilot, the **Ask Copilot** button will open the Copilot chat window, and Copilot will provide suggestions based on your code and any identified issues.
92+
9193
To analyze top insights, top functions, and the hot path, see [CPU insights](../profiling/cpu-insights.md).
9294
::: moniker-end
9395

@@ -123,7 +125,7 @@ This data can help you assess whether the function itself is a performance bottl
123125
For more information on using the Flame graph, see [Identify hot paths with Flame Graph](../profiling/flame-graph.md).
124126
::: moniker-end
125127

126-
### <a name="BKMK_The_CPU_Usage_call_tree"></a> The CPU Usage call tree
128+
### <a name="BKMK_The_CPU_Usage_call_tree"></a> CPU Usage call tree
127129

128130
To view the call tree, select the parent node in the report. By default, the **CPU Usage** page opens to the **Caller/Callee** view. In the **Current View** dropdown, select **Call Tree**.
129131

@@ -140,7 +142,7 @@ You can click the **Expand Hot Path** and **Show Hot Path** buttons to see the f
140142

141143
|Image|Description|
142144
|-|-|
143-
|![Step 1](../profiling/media/procguid_1.png "ProcGuid_1")|The top-level node in CPU Usage call trees is a pseudo-node.|
145+
|![Step 1](../profiling/media/procguid_1.png "ProcGuid_1")|The top-level node in CPU Usage call tree, representing the application.|
144146
|![Step 2](../profiling/media/procguid_2.png "ProcGuid_2")|In most apps, when the **Show External Code** option is disabled, the second-level node is an **[External Code]** node. The node contains the system and framework code that starts and stops the app, draws the UI, controls thread scheduling, and provides other low-level services to the app.|
145147
|![Step 3](../profiling/media/procguid_3.png "ProcGuid_3")|The children of the second-level node are the user-code methods and asynchronous routines that are called or created by the second-level system and framework code.|
146148
|![Step 4](../profiling/media/procguid_4.png "ProcGuid_4")|Child nodes of a method have data only for the calls of the parent method. When **Show External Code** is disabled, app methods can also contain an **[External Code]** node.|
@@ -150,9 +152,9 @@ You can click the **Expand Hot Path** and **Show Hot Path** buttons to see the f
150152
::: moniker range=">=vs-2022"
151153
System and framework functions that are executed by your code are called *external code*. External code functions start and stop the app, draw the UI, control threading, and provide other low-level services to the app. In most cases, you aren't interested in external code, so the CPU Usage call tree gathers the external functions of a user method into one **[External Call]** node.
152154

153-
To view the call paths of external code, switch the current view to the **Call Tree** view or right-click and select **View in Call Tree**.
155+
To view the call paths of external code, on the main report summary page (right pane), select **Show Just My Code** from the **Settings** dropdown, and then select **Apply**. The **Call Tree** view of the **CPU Usage** page then expands the external code calls. (The **Settings** dropdown is available on the main report summary page, not the detailed views.)
154156

155-
![Screenshot that shows Show in Call Tree.](../profiling/media/vs-2022/cpu-use-wt-call-tree-view.png "Show Call Tree")
157+
![Screenshot that shows Settings, then Show Just My Code.](../profiling/media/vs-2022/diagnostics-tools-show-external-code.png)
156158
::: moniker-end
157159
::: moniker range="vs-2019"
158160
System and framework functions that are executed by your code are called *external code*. External code functions start and stop the app, draw the UI, control threading, and provide other low-level services to the app. In most cases, you aren't interested in external code, so the CPU Usage call tree gathers the external functions of a user method into one **[External Code]** node.

docs/profiling/flame-graph.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ monikerRange: '>= vs-2022'
1313

1414
# Identify hot paths with a flame graph (C#, Visual Basic, C++, F#)
1515

16-
The **Flame Graph** in the CPU Usage tool helps you identify hot paths in your code by visualizing a call tree. Flame graphs are a visualization of categorized data, created to visualize stack traces of profiled software so that the most frequent code paths can be identified quickly and accurately. The graph gives a visual overview of where time is being spent in your application and you can click on specific nodes to dig into them further.
16+
The **Flame Graph** in the CPU Usage and Instrumentation tools help you identify hot paths in your code by visualizing a call tree. Flame graphs are a visualization of categorized data, created to visualize stack traces of profiled software so that the most frequent code paths can be identified quickly and accurately. The graph gives a visual overview of where time is being spent in your application and you can click on specific nodes to dig into them further.
1717

1818
![Screenshot showing Flame Graph with tooltips displayed.](./media/vs-2022/flame-graph-tooltips.png "Flame Graph with tooltips displayed")
1919

2020
For a tutorial that shows how to improve performance using the flame graph, see [Beginner's guide to optimizing code](../profiling/optimize-code-using-profiling-tools.md). For information on the CPU profiler, see [Analyze performance by using CPU profiling](../profiling/cpu-usage.md).
2121

2222
## Investigate hot paths
2323

24-
1. The Flame Graph view is in the details view of the CPU Usage tool, above the source line highlighting view. After you've stopped your profiling session, you can view the Flame Graph by clicking **Open details**.
24+
1. The Flame Graph view is in the details view of the tool, above the source line highlighting view. After you've stopped your profiling session, you can view the Flame Graph by clicking **Open details**.
2525

2626
![Screenshot showing Open details selected.](./media/vs-2022/flame-graph-open-details.png "Open details view selected")
2727

@@ -31,7 +31,7 @@ For a tutorial that shows how to improve performance using the flame graph, see
3131

3232
![Screenshot showing Flame Graph overview displayed.](./media/vs-2022/flame-graph-overview.png "Flame Graph overview displayed")
3333

34-
1. By default, the flame graph in the CPU tool is shown upside down or as an "icicle chart," where the y-axis is counting stack depth downwards from zero at the top. You can view the standard flame chart layout by clicking **Flip Flame Graph**.
34+
1. By default, the flame graph in the tool is shown upside down or as an "icicle chart," where the y-axis is counting stack depth downwards from zero at the top. You can view the standard flame chart layout by clicking **Flip Flame Graph**.
3535

3636
![Screenshot showing Flip Flame Graph selected.](./media/vs-2022/flame-graph-flip.png "Flip Flame Graph selected")
3737

0 commit comments

Comments
 (0)