Skip to content

Commit

Permalink
Merge pull request #10597 from MicrosoftDocs/main638737096275972477sy…
Browse files Browse the repository at this point in the history
…nc_temp

For protected branch, push strategy should use PR and merge to target branch method to work around git push error
  • Loading branch information
learn-build-service-prod[bot] authored Jan 29, 2025
2 parents 62c9884 + 8192d27 commit b001699
Show file tree
Hide file tree
Showing 31 changed files with 479 additions and 419 deletions.
2 changes: 1 addition & 1 deletion docs/debugger/debug-interface-access/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
href: idiaenumlinenumbers-reset.md
- name: IDiaEnumLineNumbers::Skip
href: idiaenumlinenumbers-skip.md
- name: IDiaEnumDebugStreams
- name: IDiaEnumNamedStreams
items:
- name: IDiaEnumNamedStreams
href: idiaenumnamedstreams.md
Expand Down
38 changes: 19 additions & 19 deletions docs/debugger/debug-with-copilot.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Debug with GitHub Copilot
description: Use Copilot to help debug your apps and provide performance insights.
ms.date: 10/29/2024
ms.date: 1/27/2025
ms.topic: how-to
dev_langs:
- CSharp
Expand All @@ -23,14 +23,7 @@ monikerRange: '>= vs-2022'

In this article, you'll learn how to debug more efficiently using GitHub Copilot. Copilot can provide code fixes along with in-depth analysis and explanations of how code works. It helps with proposed fixes to bugs, and explains things such as exceptions. Copilot understands call stacks, frames, variable names, and values. As a result, you can interact with the debugger-aware AI to ask detailed questions related to your code and to debugging issues in general.

In addition, Copilot provides more precise help for some targeted scenarios, such as the following:

- Exceptions
- Variables
- Deadlocks
- Quick Actions (light bulb)

To get AI assistance while you're debugging in these scenarios, look for the **Ask Copilot** ![Screenshot of Ask Copilot button.](../debugger/media/vs-2022/debug-with-copilot-ask-copilot-button.png) button. In these scenarios, Copilot already knows the context for your questions. For example, it knows the current call stack, the code line you are asking about, and the name of the exception (if one occurred), so you don't need to provide context yourself in chat. Copilot also provides suggestions for the use of conditional breakpoints and tracepoints.
In addition, Copilot provides more precise help for some targeted scenarios, such as Exceptions, and all those described in [Targeted scenarios for AI assistance](#targeted-scenarios-for-ai-assistance). In most of these scenarios, look for the **Ask Copilot** ![Screenshot of Ask Copilot button.](../debugger/media/vs-2022/debug-with-copilot-ask-copilot-button.png) button. In these scenarios, Copilot already knows the context for your questions.

For more information on GitHub Copilot Completions in Visual Studio, see [About GitHub Copilot Completions in Visual Studio](../ide/visual-studio-github-copilot-extension.md).

Expand All @@ -46,7 +39,7 @@ To get started, you need:
> [!NOTE]
> If you experience authentication issues after installing the extension, see [Troubleshooting authentication issues with GitHub Copilot Chat](https://docs.github.com/en/copilot/troubleshooting-github-copilot/troubleshooting-authentication-issues-with-github-copilot-chat).
## Get AI assistance to debug your app
## Debug using Copilot

The following simple example shows how to get AI assistance using the inline Chat view.

Expand Down Expand Up @@ -131,7 +124,7 @@ The following simple example shows how to get AI assistance using the inline Cha

1. Choose **Cancel** so we can continue learning other features of Copilot in the next section.

## Get AI assistance for an exception
## Debug an exception with Copilot

The following simple example shows how to get AI assistance when you encounter an exception and how to quickly update your code based on AI-suggested fixes.

Expand Down Expand Up @@ -167,7 +160,7 @@ The following simple example shows how to get AI assistance when you encounter a

This time, no exception occurs. It has been fixed!

## Get AI assistance with conditional breakpoints and tracepoints
## Get suggestions with conditional breakpoints and tracepoints

Copilot gives you suggestions for [conditional breakpoints](../debugger/using-breakpoints.md#breakpoint-conditions) and [tracepoints](../debugger/using-tracepoints.md) that are specific to your code.

Expand Down Expand Up @@ -215,14 +208,21 @@ In this example, we show AI suggestions for a conditional breakpoint. For tracep

When the debugger pauses at the breakpoint, check the value of `item` and verify that the current value is `Fred`.

## Get AI assistance in the IEnumerable tabular visualizer

For AI assistance for the IEnumerable tabular visualizer, see [Modify the visualizer expression](../debugger/view-data-in-tabular-visualizer.md#modify-the-expression-in-the-ienumerable-visualizer).
## Targeted scenarios for AI assistance

## Get AI assistance for auto insights
Copilot understands call stacks, frames, variable names, and values. As a result, you can interact with the debugger-aware AI to ask detailed questions related to your code and to debugging issues in general.

In addition to interactive debugging assistance, Copilot provides detailed information in the CPU Usage [Auto Insights](../profiling/cpu-insights.md). It provides information and insights related to a set of specific performance insights. With Copilot, ask questions about functions on the identified hot paths in your code, which can help you produce more efficient or cost-effective code.
In addition, Copilot provides more precise help for some targeted scenarios, such as those described in the following table.

The **Ask Copilot** button appears even if no specific performance insights are identified. Select **Ask Copilot** to learn from Copilot and start asking questions.
|Scenario|Link|
|-|-|
|Exceptions|See [Debug an exception with Copilot](#debug-an-exception-with-copilot) in this article. Help with exceptions includes help with deadlock detection errors.|
|Variables|See [Debug using Copilot](#debug-using-copilot) in this article.|
|Conditional breakpoints and tracepoints|See [Get suggestions with conditional breakpoints and tracepoints](#get-suggestions-with-conditional-breakpoints-and-tracepoints) in this article.|
|Quick Actions (light bulb)|See [Get AI assistance with Quick Actions](../ide/quick-actions.md#get-ai-assistance).|
|IEnumerable tabular visualizer|See [Modify the visualizer expression](../debugger/view-data-in-tabular-visualizer.md#modify-the-expression-in-the-ienumerable-visualizer).|
|Inline return values|See [View return values of method calls](../debugger/debugger-feature-tour.md#view-return-values-of-method-calls).|
|Summary thread descriptions|See [Threads View (Parallel Stacks)](../debugger/using-the-parallel-stacks-window.md#threads-view).|
|Auto insights for profiling|See [Get AI assistance with Auto insights](../profiling/cpu-insights.md#get-ai-assistance).|

[ ![Animation of using Copilot with CPU Usage.](../debugger/media/vs-2022/debug-with-copilot-top-insights.gif) ](../debugger/media/vs-2022/debug-with-copilot-top-insights.gif#lightbox)
In most of these scenarios, you get targeted assistance by using the **Ask Copilot** ![Screenshot of Ask Copilot button.](../debugger/media/vs-2022/debug-with-copilot-ask-copilot-button.png) button. Copilot already knows the context for your questions. For example, it knows the current call stack, the code line you are asking about, and the name of the exception (if one occurred), so you don't need to provide context yourself in chat. Copilot also provides suggestions for the use of conditional breakpoints and tracepoints.
5 changes: 4 additions & 1 deletion docs/debugger/debugger-feature-tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "First look at the debugger"
description: Get started debugging your applications by using the Visual Studio debugger and see what your code is doing while it runs.
ms.topic: conceptual
ms.date: 11/5/2024
ms.date: 1/27/2025
helpviewer_keywords:
- "debugger"
author: mikejo5000
Expand Down Expand Up @@ -190,6 +190,9 @@ Starting in Visual Studio 2022 version 17.12 Preview 3, you can also view return

[ ![Screenshot showing the return values of method calls.](../debugger/media/vs-2022/view-return-values.png) ](../debugger/media/vs-2022/view-return-values.png#lightbox)

With Copilot enabled, you can also get targeted assistance related to the inline return value by using the Ask Copilot button that appears in the data tip for the return value.

[ ![Screenshot showing the return values of method calls with Copilot icon.](../debugger/media/vs-2022/view-return-values-copilot.png) ](../debugger/media/vs-2022/view-return-values-copilot.png#lightbox)
::: moniker-end

## Set a watch
Expand Down
2 changes: 1 addition & 1 deletion docs/debugger/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ landingContent:
- text: Get started measuring memory usage
url: ../profiling/memory-usage.md
- text: AI-assisted CPU usage auto insights with Copilot
url: debug-with-copilot.md#get-ai-assistance-for-auto-insights
url: ../profiling/cpu-insights.md#get-ai-assistance
- linkListType: overview
links:
- text: First look at profiling tools
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/debugger/media/vs-2022/view-return-values.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/debugger/using-the-parallel-stacks-window.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Icon|Description|
|![Status Excluded](media/vs-2022/icon-status-excluded.png)|Indicates the deadlocked node.|
|![Status Information](media/vs-2022/icon-status-information.png)|Indicates that the current stack frame has additional information such as Waiting on, Waiting on lock, owned by, etc. |
|![Status Blocked](media/vs-2022/icon-status-block.png)|Indicates that the current task is in blocked/waiting state, etc. |
|![Status Running](media/vs-2022/icon-status-running.png)|Indicates that the currently running task.|
|![Status Running](media/vs-2022/icon-status-running.png)|Indicates the currently running task.|

::: moniker-end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ The Visual Studio Editor extensibility object model is composed of a few integra

- This object is immutable and will never change after it is created.
- You can use `ITextViewSnapshot.GetTextDocumentAsync()` to get the content from the document. Calling this method is expensive and only should be done if you need the document content.
- `ITextViewSnapshot` can't be changed directly. All changes are requested via mutation. See [Make changes in a text document from an extension](editor.md#make-changes-in-a-text-document-from-an-extension).
- `ITextViewSnapshot` can't be changed directly. All changes are requested via mutation. See [Make changes in a text document from an extension](./walkthroughs/editing-text.md).

## ITextDocumentSnapshot

[ITextDocumentSnapshot](/dotnet/api/microsoft.visualstudio.extensibility.editor.itextdocumentsnapshot) contains the content of the text document from a point in time or version.

- This object is immutable and will never change after it is created.
- `ITextDocumentSnapshot` can't be changed directly. All changes are requested via mutation. See [Make changes in a text document from an extension](editor.md#make-changes-in-a-text-document-from-an-extension).
- `ITextDocumentSnapshot` can't be changed directly. All changes are requested via mutation. See [Make changes in a text document from an extension](./walkthroughs/editing-text.md).

If you're familiar with legacy Visual Studio extensions, [ITextDocumentSnapshot](/dotnet/api/microsoft.visualstudio.extensibility.editor.itextdocumentsnapshot) is almost the same as
[ITextSnapshot](/dotnet/api/microsoft.visualstudio.text.itextsnapshot) and supports most of the same methods for accessing the text.
Expand Down
Loading

0 comments on commit b001699

Please sign in to comment.