You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ide/copilot-chat-context.md
+4-13Lines changed: 4 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: 'Tips & Tricks for GitHub Copilot Chat in Visual Studio'
3
-
description: Use slash commands, references, and threads to form better questions and get better answers with scoped context in GitHub Copilot Chat.
2
+
title: 'Use slash commands in Copilot Chat'
3
+
description: Use slash commands to form better questions and get better answers with scoped context in GitHub Copilot Chat.
4
4
ms.date: 7/31/2025
5
5
ms.topic: how-to
6
6
author: anandmeg
@@ -13,14 +13,13 @@ helpviewer_keywords:
13
13
- context, copilot chat
14
14
monikerRange: '>= vs-2022'
15
15
---
16
-
# Get better answers by setting the context for GitHub Copilot Chat in Visual Studio
16
+
# Use slash command to set the chat context
17
17
18
-
You can ask [**GitHub Copilot Chat**](visual-studio-github-copilot-chat.md) to give you code suggestions, explain code, generate unit tests, and suggest code fixes. In addition to your prompt, Copilot uses additional context, like the code in your current file and the chat history, to generate a response.
18
+
You can ask [**GitHub Copilot Chat**](visual-studio-github-copilot-chat.md) to give you code suggestions, explain code, generate unit tests, and suggest code fixes. In addition to your prompt, Copilot uses additional context, like the code in your current file, any attached images, and the chat history, to generate a response.
19
19
20
20
In this article, you learn how to get better answers by providing more information to Copilot Chat:
21
21
+ Use [slash commands](#slash-commands) to quickly specify common tasks like `/explain` to get code explanations.
22
22
+ Use the [guided chat experience](#prompting-guidance) and [custom instructions](#enable-custom-instructions) to refine context.
23
-
+[Attach images](#attach-images) to your prompt to provide additional context and better illustrate your ideas.
24
23
25
24
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).
26
25
@@ -83,14 +82,6 @@ You can use slash commands in a [chat window](visual-studio-github-copilot-chat.
83
82
84
83
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.
85
84
86
-
## <aname="attach-images"></a>Attach images to a chat prompt
87
-
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.
89
-
90
-
In the following example, Copilot interprets the attached image to generate a plan and suggest code to create a colorful Breakout game from scratch.
91
-
92
-
:::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" :::
93
-
94
85
## Next steps
95
86
96
87
-[GitHub Copilot experience for Visual Studio](visual-studio-github-copilot-extension.md)
0 commit comments