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/getting-started-chat.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,10 +52,12 @@ In this tutorial, you'll be creating a simple Node.js web application. So, let's
52
52
53
53

54
54
55
-
You can interact with these code blocks by copying the content in the editor or inserting it in the terminal.
55
+
When Copilot returns a code block, you can select the **Apply in Editor** button to let Copilot insert the code in the active editor for you at the appropriate location. Alternatively, you can also insert the code at the cursor position, or copy the code to the clipboard.
56
56
57
57

58
58
59
+
When the chat response contains links to a file, you can drag and drop that file from the Chat view to the editor to open it.
60
+
59
61
> **Tip**: Experiment with different questions and see how Copilot responds. For example, you can ask for only code samples ("give me 3 code samples to create an express app"), or ask how to add basic authentication to an Express app ("how to create an express app with basic auth"), and much more!
60
62
61
63
## Generate a new workspace
@@ -70,13 +72,13 @@ Let's ask Copilot to generate a workspace for an Express.js and Pug application.
70
72
71
73
*`@workspace` is a *chat participant*, which are domain experts that can perform tasks or answer questions in a specific domain. In this case, `@workspace` knows about VS Code workspaces and your codebase.
72
74
73
-
*`/new` is a *slash command* that tells the `@workspace` participant that you want to create a new workspace. Slash commmands are a shorthand for commonly used instructions. You can enter the `/` symbol in the chat input to get the list of supported commands.
75
+
*`/new` is a *slash command* that tells the `@workspace` participant that you want to create a new workspace. Slash commands are a shorthand for commonly used instructions. You can enter the `/` symbol in the chat input to get the list of supported commands.
74
76
75
77
1. Copilot returns a file tree that represents the new workspace files, and a button to create the workspace.
76
78
77
79

78
80
79
-
You can select any file in the file tree to preview its content.
81
+
You can select any file in the file tree to preview the content before it's actually created. If you're not happy with the generated files, or want something different, you can ask follow-up questions, like `@workspace use ejs` to use EJS instead of Pug.
80
82
81
83
1. Select **Create workspace** to create a new workspace and select a folder on disk where the workspace should be created.
82
84
@@ -88,7 +90,9 @@ Congratulations! You've just created a workspace with Copilot Chat by using natu
88
90
89
91
## Use chat participants
90
92
91
-
Previously, you used `@workspace` to generate a new workspace, but you can also use it to ask questions about the actual code in the workspace.
93
+
Previously, you already used the `@workspace` chat participant to generate a new workspace, but you can also use it to ask questions about the actual code in the workspace.
94
+
95
+
Let's iterate on our generated Express app and add a new page to it.
92
96
93
97
1. In the Chat view, enter the *@workspace how to add a new page?*
94
98
@@ -100,11 +104,11 @@ Previously, you used `@workspace` to generate a new workspace, but you can also
100
104
101
105
> **Tip**: You can add more details about the type of page you want to add, such as a home page, a contact page, or a product page.
102
106
103
-
1. There are more chat participants that you can use. Start typing `@` in the chat window to get the list of available chat participants.
107
+
1. There are more chat participants that you can use, each with its own domain-specific expertise. Select the <iclass="codicon codicon-mention"></i> icon or just type `@` in the Chat view to get the list of available chat participants.
104
108
105
109

106
110
107
-
> **Note**: The list of participants might vary based on the extensions you have installed in VS Code.
111
+
> **Note**: Extensions can also contribute chat participants, so the list might vary based on the extensions you have installed in VS Code.
108
112
109
113
1. Let's use `@vscode` to ask about VS Code. Enter `@vscode how to debug node.js app` in the chat input field.
110
114
@@ -136,9 +140,9 @@ Let's look at how to use chat for code refactoring.
136
140
137
141

138
142
139
-
You can view the applied changes by selecting the **Toggle Changes** control.
143
+
You can view the applied changes by selecting **More Actions** > **Toggle Changes**.
140
144
141
-

145
+

142
146
143
147
1. Select **Accept** or **Discard** to apply or ignore the changes.
144
148
@@ -166,11 +170,11 @@ Let's see how to use smart actions to fix a coding error.
166
170
167
171
Notice how Copilot uses the `/fix` slash command, followed by the error message. You can also use the `/fix` command directly in the chat input field to get help with fixing coding errors.
168
172
169
-
In addition to **Fix This**, Copilot provides more smart code actions, such as **Explain This**, **Generate Docs** (`/doc`), and **Generate Tests** (`/tests`). You can access these actions via the editor context menu and then selecting **Copilot**.
173
+
In addition to **Fix**, Copilot provides more smart code actions, such as **Explain** (/explain), **Generate Docs** (`/doc`), and **Generate Tests** (`/tests`). You can access these actions via the editor context menu and then selecting **Copilot**.
170
174
171
175

172
176
173
-
And if you come across some block of code that's unclear, use `/explain` to get Copilot to give you an explanation and help improve your code understanding.
177
+
And if you come across some block of code that's unclear, just select it and use `/explain` to get Copilot to give you an explanation and help improve your code understanding.
174
178
175
179
## Add chat context
176
180
@@ -198,9 +202,11 @@ Let's ask Copilot about what the purpose of a specific file in the workspace is.
198
202
199
203
Copilot now returns an explanation about the purpose of the code in the selected file.
200
204
201
-
1. Instead of using the **Attach Context** control, you can also reference different types of context by `#` in the chat input field.
205
+
1. Instead of using the **Attach Context** control, you can also directly reference the different types of context by typing `#` in the chat input field.
206
+
207
+
To quickly attach a file as context for your chat prompt, you can drag and drop a file from the Explorer view onto the Chat view. If the file is open in the editor, you can also drag and drop the editor tab onto the Chat view to attach the file.
202
208
203
-

209
+

Asyouworkonanexisting codebase, youoftenneedtorefactororimproveexistingcode. Withthe [CopilotChat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extension, you can use AI-driven chat conversations in VS Code to ask specific tasks about your code.
67
+
Withthe [CopilotChat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extension, you can start a chat conversations with Copilot in VS Code to ask specific tasks about your code by using natural language.
68
68
69
-
Let's use Copilot Chat to help us with generating and refactoring code.
69
+
Let's use Copilot Chat to help us generate a simple Express web server.
Asyou're working in a new codebase, or exploring a new programming language, you might have more general questions come up. Copilot Chat lets you open a chat conversation on the side, and which keeps track of the history of your questions.
119
+
Asyou're working in a new codebase, or exploring a new programming language, you might have more general coding questions come up. Copilot Chat lets you open a chat conversation on the side, and which keeps track of the history of your questions.
0 commit comments