Skip to content

Commit a3b6193

Browse files
committed
Update Chat for 1.96
1 parent f7de401 commit a3b6193

File tree

3 files changed

+56
-58
lines changed

3 files changed

+56
-58
lines changed

docs/copilot/copilot-chat.md

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Copilot Chat integrates in your developer flow and gives you assistance where yo
1818
* [**Chat view**](#chat-view): have an AI assistant on the side to help with your questions and to provide code suggestions
1919
* [**Quick Chat**](#quick-chat): ask a quick question and get back into what you're doing
2020

21+
> [!TIP]
22+
> If you intend to make edits across multiple files in your project, you might consider using [Copilot Edits](/docs/copilot/copilot-edits.md). You can easily [move an existing chat conversation to Copilot Edits](/docs/copilot/copilot-edits.md#send-a-chat-request-to-copilot-edits).
23+
2124
## Copilot Chat use cases
2225

2326
You can use Copilot Chat in various developer scenarios, such as:
@@ -37,7 +40,7 @@ You can use Copilot Chat in various developer scenarios, such as:
3740

3841
Follow these steps to [set up GitHub Copilot in VS Code](/docs/copilot/setup.md) by signing up for a subscription and installing the Copilot extension in VS Code.
3942

40-
## Getting started
43+
## Getting started with Copilot Chat
4144

4245
### Open chat
4346

@@ -57,24 +60,35 @@ Or use one of the keyboard shortcuts to start a chat conversation with Copilot.
5760

5861
Copilot tries to determine the intent and scope of your question based on your natural language chat prompt. To help Copilot give you the best and most relevant answers, add context to your chat prompt. For example, attach specific files or even the full contents of your workspace, the current editor selection, and more.
5962

60-
You can add context to your chat message by using the <i class="codicon codicon-attach"></i> button (`kb(workbench.action.chat.attachContext)`) in any of the chat experiences. You can then select the specific type of context from a Quick Pick, such as the current selection, one or more files from the workspace, or one or more symbols from your source code.
63+
VS Code automatically adds the currently active editor as context to your chat prompt in the Chat view. If you have a block of code selected in the editor, only that selection is added as context. You can disable adding the active editor by selecting the disable icon on the context item.
6164

62-
![Screenshot of VS Code Copilot Chat view, showing the Attach context button and context Quick Pick.](./images/copilot-chat/copilot-chat-view-attach-context.png)
65+
![Screenshot of VS Code Copilot Chat view, showing the current editor selection as context.](./images/copilot-chat/copilot-chat-view-selection-context.png)
6366

64-
> [!TIP]
65-
> To quickly add multiple items from the attachment Quick Pick, use the `kbstyle(Up)` and `kbstyle(Down)` keys to navigate the list, use the `kbstyle(Right)` key to add the item as context, and then repeat this for other items.
67+
There are several ways to add context to your chat prompt:
6668

67-
Another quick way to add specific files to your chat prompt is to drag and drop files from the Explorer or Search view onto the chat input field. You can also drag and drop an editor tab onto the chat input field to add the file as context.
69+
* Use the <i class="codicon codicon-attach"></i> button (`kb(workbench.action.chat.attachContext)`) in any of the chat experiences.
6870

69-
<video src="images/copilot-chat/copilot-attach-dnd.mp4" title="Dragging files and editors into chat" autoplay loop controls muted></video>
71+
You can then select the specific type of context from a Quick Pick, such as the current selection, one or more files from the workspace, or one or more symbols from your source code.
7072

71-
VS Code automatically adds the currently active editor as context to your chat prompt in the Chat view. If you have a block of code selected in the editor, only that selection is added as context. You can disable adding the active editor by selecting the disable icon on the context item.
73+
![Screenshot of VS Code Copilot Chat view, showing the Attach context button and context Quick Pick.](./images/copilot-chat/copilot-chat-view-attach-context.png)
7274

73-
![Screenshot of VS Code Copilot Chat view, showing the current editor selection as context.](./images/copilot-chat/copilot-chat-view-selection-context.png)
75+
> [!TIP]
76+
> To quickly add multiple items from the attachment Quick Pick, use the `kbstyle(Up)` and `kbstyle(Down)` keys to navigate the list, use the `kbstyle(Right)` key to add the item as context, and then repeat this for other items.
7477
75-
You can also reference context by using chat variables. Type the `#` character and you'll see a list of available chat variables. For example, you can use `#selection` to add the current editor selection to your chat prompt, or `#file` to add a specific file from the workspace.
78+
* Drag and drop editor tabs, or files or folders from the Explorer view, Search view, or editor breadcrumb onto the Chat view.
7679

77-
![Screenshot of VS Code Copilot Chat view, showing the chat variable picker.](./images/copilot-chat/copilot-chat-view-chat-variables.png)
80+
<video src="images/copilot-chat/copilot-attach-dnd.mp4" title="Dragging files and editors into chat" autoplay loop controls muted></video>
81+
82+
* Use chat variables by typing the `#` character and you'll see a list of available chat variables.
83+
84+
For example, you can use `#selection` to add the current editor selection to your chat prompt, `#file` to add a specific file from the workspace, or `#sym` to add a symbol from the workspace.
85+
86+
![Screenshot of VS Code Copilot Chat view, showing the chat variable picker.](./images/copilot-chat/copilot-chat-view-chat-variables.png)
87+
88+
> [!TIP]
89+
> Type `#` and use it as an IntelliSense trigger for file or symbol suggestions.
90+
91+
* Use the context menu **Copilot** > **Add File to Chat** (or **Add Selection to Chat** for a text selection) on a file in the Explorer or Search view.
7892

7993
> [!NOTE]
8094
> If possible, the full contents of the file will be included when you attach a file. If that is too large to fit into the context window, an outline of the file will be included that includes functions and their descriptions without implementations. If the outline is also too large, then the file won't be part of the prompt.
@@ -219,22 +233,26 @@ Once a command is suggested, use **Run** (`kb(workbench.action.terminal.chat.run
219233

220234
Optionally, you can edit the command directly in the Copilot response before running it by placing the cursor in the response or by pressing `kbstyle(Ctrl+down)`, `kbstyle(Tab)`, `kbstyle(Tab)` on Windows & Linux, or `kbstyle(Cmd+down)`, `kbstyle(Tab)`, `kbstyle(Tab)` on macOS.
221235

222-
## Chat smart actions
236+
## Smart actions
237+
238+
Copilot Chat lets you use natural language to get help from Copilot. For several common scenarios, you can use *smart actions* to get help from Copilot without having to write a prompt. Examples of these smart actions are for tasks, such as generating commit messages, generating documentation, fixing code, explaining code, or reviewing code changes.
223239

224-
To make it easier to use Copilot Chat features, smart actions are integrated in your VS Code flow and they do not require you to write any prompt at all. For example, you can access Copilot smart actions from the editor context menu or through Quick Fix actions.
240+
These smart actions are available throughout the VS Code UI. For example, you can access Copilot smart actions from the editor context menu or through Quick Fix actions.
225241

226-
Access the smart actions by selecting a block of code, right-clicking, and choosing **Copilot**. The smart actions are context-aware and can help you with common tasks, such as generating documentation, fixing code, or explaining code.
242+
In the editor, you can access smart actions by selecting a block of code, right-clicking, and then choosing **Copilot**.
227243

228244
![Editor context menu with the Copilot menu group expanded](images/copilot-chat/copilot-smart-action-menu.png)
229245

230-
The most powerful smart action is `/fix`. Here is a relatively simple TypeScript calculator with an error noting that "Argument of type 'string' is not assignable to parameter of type 'number'". Select the *sparkle* icon, and then choose **Fix using Copilot**.
246+
The most powerful smart action is the **Fix** action. Here is a relatively simple TypeScript calculator with an error noting that "Argument of type 'string' is not assignable to parameter of type 'number'". Select the *sparkle* icon, and then choose **Fix**.
231247

232248
![Quick fix a type mismatch error by using the Copilot smart action](images/copilot-chat/smart-action-fix-with-copilot.png)
233249

234-
Similar to `/fix`, the `/doc` smart action is popular with users. To use `/doc`, select a block of code, right-click, and choose **Copilot** > **Generate Docs**. Copilot will generate a documentation comment for your code.
250+
Similar to `/fix`, the `/doc` smart action is a popular action. To use `/doc`, select a block of code, right-click, and choose **Copilot** > **Generate Docs**. Copilot will generate a documentation comment for your code.
235251

236252
![Inline Chat /doc results adding JSDoc comment for a TypeScript function](images/copilot-chat/generate-docs-example.png)
237253

254+
You can also invoke some of these smart actions by using their equivalent [slash command](#slash-commands) in chat. For example, you can use `/fix` to fix the problems in the selected code, or `/doc` to generate documentation for the selected code.
255+
238256
## Chat participants
239257

240258
*Chat participants* are like experts who have a specialty that they can help you with. You can invoke a chat participant by typing '@' in the chat input field, followed by the participant name. There are several built-in chat participants:
@@ -328,21 +346,7 @@ Some examples of built-in slash commands are:
328346

329347
To view the list of build-in participants and their commands, type `@` in the chat input field or select the <i class="codicon codicon-mention"></i> icon.
330348

331-
## Improve the performance of Copilot Chat
332-
333-
Copilot works best when it has sufficient context to know what you're doing and what you want help with. Just as you would provide a colleague with the context when asking for help with a specific programming task, you can do the same with Copilot.
334-
335-
You can help Copilot provide better answers by upvoting or downvoting responses with the thumbs up and down icons in the upper right of its response. This provides Copilot feedback on how much it helped with your scenario so that it can help you even better in the future.
336-
337-
### Use chat variables
338-
339-
By using a chat variable in your chat prompt, you can be more specific about the context that you provide to Copilot. For example, the prompt _"which sorting algo is used #selection"_ focuses the chat request on the selected code snippet.
340-
341-
### Use chat participants and commands
342-
343-
Chat participants, such as `@workspace`, might have context associated within them. For example, `@vscode` is aware of VS Code settings and its APIs. When you include a chat participant in the chat prompt, you inherently add context to the prompt. Similarly, by using slash commands, you can further focus the intent of the chat request.
344-
345-
### Conversation history
349+
## Conversation history
346350

347351
Copilot keeps track of the history of your conversation in the Chat view. Copilot can use this information as context in subsequent prompts, for example when you have a [multi-turn conversation](#multi-turn-conversations).
348352

@@ -356,14 +360,6 @@ You can delete a prompt and the corresponding response from the conversation his
356360

357361
You can export all prompts and responses for a chat session in a JSON file with the **Chat: Export Chat...** command in the Command Palette.
358362

359-
### Context in Inline Chat
360-
361-
If you're using Inline Chat, and you have code selected in the editor, Copilot scopes your question to the selection.
362-
363-
### Ignore files
364-
365-
When you're using `@workspace` to ask questions related to your VS Code workspace, you can explicitly ignore specific files from the workspace by using a `.gitignore` file. `@workspace` respects `.gitignore` when deciding which files from the workspace to index.
366-
367363
## Use voice interactions
368364

369365
With the voice control capabilities in VS Code, provided by the [VS Code Speech](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-speech) extension, you can initiate a chat conversation by using your voice:
@@ -390,30 +386,32 @@ Learn more about security, privacy, and transparency in the [GitHub Copilot Trus
390386

391387
## Frequently asked questions
392388

393-
### How do I choose between Inline Chat, Chat view, and Quick Chat?
389+
### How do I choose between Copilot Edits, Inline Chat, Chat view, and Quick Chat?
394390

395391
The following table provides a comparison of the capabilities of each interface.
396392

397-
| Capability | Chat view | Inline Chat | Quick Chat |
398-
|-------------------------------------|:---------:|:-----------:|:----------:|
399-
| Ask general technology questions || ||
400-
| Receive code suggestions || ||
401-
| View code suggestions in the editor | | | |
402-
| Code suggestions for multiple files || | |
403-
| Generate a new project || | |
404-
| Attach context || ||
405-
| Use chat participants || ||
406-
| Use commands ||* ||
407-
| Chat history || | |
393+
| Capability | Copilot Edits | Chat view | Inline Chat | Quick Chat |
394+
|------------------------------|:-------------:|:---------:|:-----------:|:----------:|
395+
| Receive code suggestions |||| |
396+
| Multi-file edits ||* | |* |
397+
| Preview code edits in editor | | || |
398+
| Code review flow || | | |
399+
| Roll back changes || | | |
400+
| Attach context |||| |
401+
| Use participants & commands | | | | |
402+
| Generate shell commands | || | |
403+
| General-purpose chat | ||| |
408404

409-
\* _only a limited set of commands is available in Inline Chat_
405+
\* _code blocks are included in the chat conversation and need to be applied to the right file manually_
410406

411407
## Additional resources
412408

413409
You can read more about [GitHub Copilot](https://github.com/features/copilot) and how to use it in VS Code in the [GitHub Copilot documentation](https://docs.github.com/copilot/getting-started-with-github-copilot?tool=vscode).
414410

415411
Or check out the [VS Code Copilot Series](https://www.youtube.com/playlist?list=PLj6YeMhvp2S5_hvBl2SE-7YCHYlLQ0bPt) on YouTube, where you can find more introductory content and programming-specific videos for using Copilot with [Python](https://www.youtube.com/watch?v=DSHfHT5qnGc), [C#](https://www.youtube.com/watch?v=VsUQlSyQn1E), [Java](https://www.youtube.com/watch?v=zhCB95cE0HY), [PowerShell](https://www.youtube.com/watch?v=EwtRzAFiXEM), [C++](https://www.youtube.com/watch?v=ZfT2CXY5-Dc), and more.
416412

417-
## Next step
413+
## Next steps
414+
415+
* Get started with the introductory [Copilot Chat tutorial](/docs/copilot/getting-started-chat.md).
418416

419-
Get started with the introductory [Copilot Chat tutorial](/docs/copilot/getting-started-chat.md).
417+
* Make edits across multiple files with [Copilot Edits](/docs/copilot/copilot-edits.md).
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)