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/copilot/copilot-chat.md
+30-27Lines changed: 30 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Copilot Chat might use syntax highlighting, indentation, and other formatting fe
16
16
17
17
Copilot Chat integrates in your developer flow and gives you assistance where you need it:
18
18
19
-
* Start an **inline chat** conversation directly from the editor or the terminal for help while you're coding
19
+
* Start an **Inline Chat** conversation directly from the editor or the terminal for help while you're coding
20
20
* Use the **Chat view** to have an AI assistant on the side to help you at any time
21
21
* Launch **Quick Chat** to ask a quick question and get back into what you're doing
22
22
@@ -38,31 +38,31 @@ You can use Copilot Chat in various scenarios, such as:
38
38
39
39
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.
40
40
41
-
## Inline chat
41
+
## Inline Chat
42
42
43
-
A key functionality of Copilot is answering questions inline, while you're coding in the editor or entering commands in the terminal. With Copilot inline chat, you can ask questions about code, get explanations, and even generate code snippets without leaving the context of your work. In any file, press `kb(inlinechat.start)` on your keyboard to bring up Copilot inline chat.
43
+
A key functionality of Copilot is answering questions inline, while you're coding in the editor or entering commands in the terminal. With Copilot Inline Chat, you can ask questions about code, get explanations, and even generate code snippets without leaving the context of your work. In any file, press `kb(inlinechat.start)` on your keyboard to bring up Copilot Inline Chat.
44
44
45
45
You can ask Copilot questions that emerge as you write and iterate on code, such as "Explain this piece of code", or "How do I add functionality to do X?".
46
46
47
-

47
+

48
48
49
49
If you have a block of code selected in the editor, Copilot scopes your question to the selection.
50
50
51
51
Depending on your question, Copilot can also suggest code modifications or refactorings. Copilot gives a preview of the updates, which you can then accept (`kb(inlineChat.acceptChanges)`) or discard (`kb(inlineChat.discard)`). Optionally, you can generate a new code suggestion.
52
52
53
-

53
+

54
54
55
-
With the `setting(inlineChat.mode)` setting, you can configure how inline chat shows updates in the editor. The default setting value is `live`, which means that the updates are applied directly in the editor, and you can compare the changes by using the inline diff viewer. If you prefer to preview the changes side-by-side, you configure the setting to `preview`.
55
+
With the `setting(inlineChat.mode)` setting, you can configure how Inline Chat shows updates in the editor. The default setting value is `live`, which means that the updates are applied directly in the editor, and you can compare the changes by using the inline diff viewer. If you prefer to preview the changes side-by-side, you configure the setting to `preview`.
56
56
57
-
The following example shows the `preview` mode for inline chat.
57
+
The following example shows the `preview` mode for Inline Chat.
58
58
59
-

59
+

60
60
61
-
## Terminal inline chat
61
+
## Terminal Inline Chat
62
62
63
-
Similar to inline chat in the editor, you can bring up Copilot inline chat in the terminal to help you answer questions related to the terminal and shell commands. The terminal inline chat uses the `@terminal` chat participant, which has context about the integrated terminal's shell and its contents. For example, you can ask questions such as "how to instal npm packages", or "list the top 5 largest files in the src directory".
63
+
Similar to Inline Chat in the editor, you can bring up Copilot Inline Chat in the terminal to help you answer questions related to the terminal and shell commands. The terminal Inline Chat uses the `@terminal` chat participant, which has context about the integrated terminal's shell and its contents. For example, you can ask questions such as "how to instal npm packages", or "list the top 5 largest files in the src directory".
64
64
65
-
To start inline chat in the terminal, press the `kb(inlinechat.start)` keyboard shortcut.
65
+
To start Inline Chat in the terminal, press the `kb(inlinechat.start)` keyboard shortcut.
66
66
67
67

68
68
@@ -96,14 +96,12 @@ As you keep the conversation going, Copilot maintains the history of your chat m
96
96
97
97
Depending on your question, Copilot Chat might return source code in a code block. Depending on the language extension, the code block in the chat response might support IntelliSense, which enables you get information about methods and symbols by hovering over them, or to go to their definition.
98
98
99
-

Hovering over the code block presents options to **Copy** and **Insert at Cursor** (`kb(workbench.action.chat.insertCodeBlock)`).
101
+
Hovering over the code block presents options to **Apply in Editor**, **Insert at Cursor**, and **Copy**.
102
102
103
103
The **More Actions** (`...`) button gives options to **Insert Into New File** and **Insert into Terminal** (`kb(workbench.action.chat.runInTerminal)`).
104
104
105
-

106
-
107
105
If Copilot Chat detects that a code block contains a command, you can run it directly in the integrated terminal with **Insert into Terminal** (`kb(workbench.action.chat.runInTerminal)`). This option creates or opens the active terminal and inserts the command text, ready for you to run.
108
106
109
107

@@ -119,7 +117,7 @@ You can control the font for code blocks in chat with the following settings:
119
117
120
118
## Quick chat
121
119
122
-
If you want to ask Copilot a quick question and don't want to start a full Chat view session or open inline chat in your editor, you can use the Quick Chat dropdown. To open Quick Chat, run **Chat: Open Quick Chat** in the Command Palette, or use the `kb(workbench.action.quickchat.toggle)` keyboard shortcut.
120
+
If you want to ask Copilot a quick question and don't want to start a full Chat view session or open Inline Chat in your editor, you can use the Quick Chat dropdown. To open Quick Chat, run **Chat: Open Quick Chat** in the Command Palette, or use the `kb(workbench.action.quickchat.toggle)` keyboard shortcut.
@@ -131,7 +129,7 @@ You can type questions, scope your questions with [chat participants](#chat-part
131
129
132
130
When you ask a question in Copilot Chat, you aren't stuck with the first response. Keep the chat conversation open and continue to iterate and prompt Copilot to improve the suggested solution. Copilot has both the context of the generated code and your current conversation history. As you keep asking additional questions, Copilot further refines the response according to your requirements.
133
131
134
-
Here's an example using inline chat to create a function to calculate Fibonacci numbers:
132
+
Here's an example using Inline Chat to create a function to calculate Fibonacci numbers:
135
133
136
134

137
135
@@ -147,15 +145,15 @@ To make it easier to use Copilot Chat features, smart actions are integrated in
147
145
148
146
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.
149
147
150
-

148
+

151
149
152
150
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**.
153
151
154
152

155
153
156
154
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.
157
155
158
-

156
+

159
157
160
158
## Chat participants
161
159
@@ -216,18 +214,21 @@ For example, we can infer that "Create a new workspace with Node.js Express Pug
216
214
217
215
Once the intent is clear, `@workspace` has a better chance of addressing your needs, despite the inherent ambiguity of natural language. The @workspace chat participant can propose a directory structure and users can select the proposed files to preview them. There is a **Create Workspace** button that generates these files in a new folder.
218
216
219
-
Examples of built-in commands:
217
+
Examples of built-in commands - type `@` or select the <iclass="codicon codicon-mention"></i> icon.
*`@workspace /explain` (or `/explain`): explain how the selected code works
225
223
*`@workspace /fix` (or `/fix`): propose a fix for the problems in the selected code
224
+
*`@workspace /fixTestFailure` (preview): propose a fix for failing tests
225
+
*`@workspace /setupTests`: configure a testing framework for your workspace
226
226
*`@workspace /tests` (or `/tests`): generate unit tests for the selected code
227
227
*`@workspace /new` (or `/new`): scaffold code for a new workspace or new file
228
228
*`@workspace /newNotebook` (or `/newNotebook`): create a new Jupyter Notebook
229
-
*`@vscode /search` (or `/search`): generate query parameters for the Search view
230
229
*`@vscode /runCommand`: search or run a VS Code command
230
+
*`@vscode /search` (or `/search`): generate query parameters for the Search view
231
+
*`@vscode /startDebugging` (experimental): generate `launch.json` file to set up debugging configuration and start debugging
231
232
*`@terminal /explain`: explain terminal functionality or shell commands
232
233
233
234
## Chat context
@@ -250,6 +251,8 @@ Instead of using the `#` symbol, you can also add context to your chat message b
250
251
251
252

252
253
254
+
To add files as context for your chat prompt, you can drag and drop files from the Explorer view onto the chat input field to add them as context. You can also drag and drop an editor tab onto the chat input field to add the file as context.
255
+
253
256
## Improve the performance of Copilot Chat
254
257
255
258
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.
@@ -278,9 +281,9 @@ You can delete a prompt and the corresponding response from the chat history by
278
281
279
282
You can export all prompts and responses for a chat session in a JSON file with the **Chat: Export Session...** command (`workbench.action.chat.export`) in the Command Palette.
280
283
281
-
### Context in inline chat
284
+
### Context in Inline Chat
282
285
283
-
If you're using inline chat, and you have code selected in the editor, Copilot scopes your question to the selection.
286
+
If you're using Inline Chat, and you have code selected in the editor, Copilot scopes your question to the selection.
284
287
285
288
### Ignore files
286
289
@@ -300,9 +303,9 @@ Learn more about how to [use voice interactions in VS Code](/docs/editor/voice.m
300
303
301
304
We emphasize responsible usage of AI, especially when it comes to source code. The `setting(inlineChat.acceptedOrDiscardBeforeSave)` setting, which is enabled by default, asks you for confirmation before saving code that was generated by Copilot.
302
305
303
-
When the setting is enabled, a file save operation waits for you to accept or discard any pending inline chat session. This also applies when Auto Save is enabled, which will be temporarily disabled until inline chat has ended.
306
+
When the setting is enabled, a file save operation waits for you to accept or discard any pending Inline Chat session. This also applies when Auto Save is enabled, which will be temporarily disabled until Inline Chat has ended.
304
307
305
-

308
+

306
309
307
310
To enable more workspace search features for private repositories, we require additional permissions. If we detect that we don't have these permissions already, we will ask for them at startup. Once granted, we'll securely store the session for the future.
0 commit comments