Skip to content

Commit 68c4edb

Browse files
committed
Updates for refactoring
1 parent 847c10d commit 68c4edb

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

docs/ide/copilot-chat-context.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Tips & Tricks for GitHub Copilot Chat in Visual Studio'
33
description: Use slash commands, references, and threads to form better questions and get better answers with scoped context in GitHub Copilot Chat.
4-
ms.date: 6/16/2025
4+
ms.date: 7/31/2025
55
ms.topic: how-to
66
author: anandmeg
77
ms.author: meghaanand
@@ -21,9 +21,6 @@ In this article, you learn how to get better answers by providing more informati
2121
+ Use [slash commands](#slash-commands) to quickly specify common tasks like `/explain` to get code explanations.
2222
+ Use the [guided chat experience](#prompting-guidance) and [custom instructions](#enable-custom-instructions) to refine context.
2323
+ [Attach images](#attach-images) to your prompt to provide additional context and better illustrate your ideas.
24-
+ Scope the chat to specific files using [references](#reference).
25-
+ Review the [source used](#find-context) by Copilot to generate the answer.
26-
+ Use different [threads](#threads) for each of your Copilot chats so you can maintain different contexts in each.
2724

2825
Learn more about [AI-assisted development in Visual Studio](../ide/ai-assisted-development-visual-studio.md) and how to [use Copilot Chat in Visual Studio](../ide/visual-studio-github-copilot-chat.md#use-copilot-chat-in-visual-studio).
2926

@@ -32,7 +29,7 @@ Learn more about [AI-assisted development in Visual Studio](../ide/ai-assisted-d
3229
To get started using GitHub Copilot Chat in Visual Studio, you need:
3330
+ Visual Studio 2022 [version 17.10](/visualstudio/releases/2022/release-history) or later
3431
+ [Sign in to Visual Studio using a GitHub account](work-with-github-accounts.md) with [Copilot access](https://docs.github.com/en/copilot/about-github-copilot/what-is-github-copilot#getting-access-to-copilot) <br/>
35-
<sup>**</sup> You can use [GitHub Copilot for Free](copilot-free-plan.md).
32+
<sup>**</sup> You can sign up for [GitHub Copilot for Free](copilot-free-plan.md).
3633

3734
Support for GitHub Copilot Chat will be provided by GitHub and can be reached at https://support.github.com.
3835

@@ -80,15 +77,15 @@ You can use slash commands in a [chat window](visual-studio-github-copilot-chat.
8077
| /generate | Generate code to answer specified question. <br> Example: `/generate code to add two numbers in Calculator.cs`| Yes | Yes |
8178
| /help | Get help on using Copilot Chat. <br> Example: `/help`| Yes | Yes |
8279
| /optimize | Analyze and improve running time of the selected code. <br> Examples:<br> - `/optimize the AddItemToBasket method in BasketService.cs`</br>- select desired code and enter `/optimize`| Yes | Yes |
83-
| /tests| Create unit tests for the selected code.<br> Example: select desired code and enter `/tests using XUnit Framework`| Yes | Yes |
80+
| /tests| Create unit tests for the selected code.<br> Example: select desired code and enter `/tests using XUnit Framework`| Yes | Yes |
8481

8582
:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-context-slash-commands.png" alt-text="Screenshot of slash commands in inline chat view and chat windows.":::
8683

8784
With Visual Studio 2022 version 17.13, as the user types a slash command, the command expands out the prompt in natural language to display the context the command will use.
8885

8986
## <a name="attach-images"></a>Attach images to a chat prompt
9087

91-
With vision integration for Copilot Chat in Visual Studio 17.14 Preview 1 and later, you can [attach images](visual-studio-github-copilot-chat.md#attach-images-to-chat-prompts) to your chat prompt, providing Copilot with additional context for improved responses. Use images in combination with [scope](#reference) and other contextual features such as slash commands to generate tailored responses.
88+
With vision integration for Copilot Chat in Visual Studio 17.14 and later, you can [attach images](visual-studio-github-copilot-chat.md#attach-images-to-chat-prompts) to your chat prompt, providing Copilot with additional context for improved responses. Use images in combination with [scope](copilot-chat-referencing-context.md#reference-context) and other contextual features such as slash commands to generate tailored responses.
9289

9390
In the following example, Copilot interprets the attached image to generate a plan and suggest code to create a colorful Breakout game from scratch.
9491

docs/ide/copilot-chat-referencing-context.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ Visual Studio automatically provides context to the chat prompt based on your cu
3030

3131
The following information is implicitly included in the chat context:
3232
- The currently selected text in the active editor.
33-
- The file name or notebook name of the active editor.
33+
- The current file active in the editor.
3434

35-
The actual contents of the active file are not included in the context, but are shown as a suggested context item in the chat input box (indicated with italic text and a dotted outline). Depending on your prompt, Visual Studio might decide to read the contents of the active file. To explicitly include the contents of the active file in the chat context, select the suggested file in the chat input box.
35+
Depending on your prompt, Copilot reads the contents of the active file. To explicitly include the contents of another file in the chat context, select the suggested file using the `+` button in the chat view to **Add attachment**.
3636

3737
:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-implicit-context.png" alt-text="Screenshot of implicit context in Copilot Chat.":::
3838

39-
## Reference: scope Copilot results
39+
## <a name="reference-context"></a>Reference: scope Copilot results
4040

4141
You can ask your coding related questions in natural language and GitHub Copilot Chat will answer these in the context of the codebase open in Visual Studio. With references you can get more specific about the information you want Copilot to consider when answering your question.
4242

@@ -68,6 +68,14 @@ With Visual Studio 2022 version 17.11, [GitHub Copilot Enterprise](https://docs.
6868

6969
:::image type="content" source="media/vs-2022/copilot-chat-context/copilot-chat-context-at-github.png" alt-text="Screenshot of using GitHub skills in Copilot Chat.":::
7070

71+
## <a name="attach-images"></a>Reference an image
72+
73+
With vision integration for Copilot Chat in Visual Studio 17.14 and later, you can [attach images](visual-studio-github-copilot-chat.md#attach-images-to-chat-prompts) to your chat prompt, providing Copilot with additional context for improved responses. Use images in combination with [scope](#reference-context) and other contextual features such as [slash commands](copilot-chat-context.md#slash-commands) to generate tailored responses.
74+
75+
In the following example, Copilot interprets the attached image to generate a plan and suggest code to create a colorful Breakout game from scratch.
76+
77+
:::image type="content" source="media/vs-2022/visual-studio-github-copilot-chat/example-attach-image-chat.png" alt-text="Screenshot of an example scenario of adding an image in Copilot Chat." lightbox="media/vs-2022/visual-studio-github-copilot-chat/example-attach-image-chat.png" :::
78+
7179
### Reference output window
7280

7381
You can now use the output window as context in chat to ask questions and get help with output logs. Supported output windows include Build, Debug, Tests, Source Control, Package Manager, or any other active output window pane.
-27.6 KB
Loading

0 commit comments

Comments
 (0)