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: Instructions/Labs/LAB_AK_02_analyze_document_code.md
+22-36Lines changed: 22 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ Use the following steps to set up the library application:
102
102
103
103
For example, in the SOLUTION EXPLORER view, right-click **AccelerateDevGHCopilot**, and thenselect**Build**.
104
104
105
-
You'll see some Warnings, but there shouldn't be any Errors.
105
+
You may see some Warnings, but there shouldn't be any Errors.
106
106
107
107
## Use GitHub Copilot to explain the library application codebase
108
108
@@ -112,9 +112,9 @@ GitHub Copilot can help you to understand an unfamiliar codebase by generating e
112
112
113
113
GitHub Copilot's Chat view includes a chat-based interface that allows you to interact with GitHub Copilot using natural language prompts. When evaluating an existing codebase forthe first time, you can create prompts that generate an explanation at the workspace or project level, or at the code block or code line level. To assist youin specifying the context of your prompt, GitHub Copilot provides chat participants, chat variables, and slash commands.
114
114
115
-
- Chat participants are used to scope your prompt to a specific domain.
116
-
- Chat variables are used to include specific context in your prompt.
117
-
- Slash commands are used to avoid writing complex prompts for common scenarios.
115
+
- Use chat participants inyour prompts to invoke a domain-specific expert. Experts provide the most accurate responses.
116
+
- Use chat variables in your prompts to include specific context. Context helps GitHub Copilot generate more relevant responses.
117
+
- Use slash commands in your prompts to invoke specific actions or to set the intent of your prompt.
118
118
119
119
Use the following steps to complete this section of the exercise:
120
120
@@ -124,25 +124,21 @@ Use the following steps to complete this section of the exercise:
124
124
125
125
To open the Chat view, select the **Toggle Chat** button at the top of the Visual Studio Code window.
126
126
127
-

128
-
129
127
You can also open the Chat view using the **Ctrl+Alt+I** keyboard shortcut.
130
128
131
-
1. In the Chat view, enter a prompt that uses GitHub Copilot's **@workspace** Chat participant to generate a description of the project.
129
+
1. In the Chat view, enter a prompt that uses the **#codebase** chat variable to include the full context of the codebase when generating a description of your code.
132
130
133
131
For example, enter the following prompt in the Chat view:
134
132
135
133
```plaintext
136
-
@workspace describe this project
134
+
#codebase describe this project
137
135
```
138
136
139
-
Use Chat participants, such as the **@workspace**, to improve the responses generated by GitHub Copilot. Chat participants work like domain experts who can help you in their specialized areas. Use **@workspace** when you want GitHub Copilot to consider the structure of your project, how different parts of your code interact, or design patterns in your project.
140
-
141
-
To see a list of all available chat participants, type **@** in the chat prompt box.
137
+
Use chat variables, such as **#codebase**, to include specific context in your prompt. Context helps GitHub Copilot generate more relevant responses.
142
138
143
139
1. Take a minute to compare GitHub Copilot's response with the actual project files.
144
140
145
-
You should see a response that describes each of the projects in the solution:
141
+
You should see a response that describes all of the projects includedin the solution:
146
142
147
143
- **Library.ApplicationCore**
148
144
- **Library.Console**
@@ -151,39 +147,31 @@ Use the following steps to complete this section of the exercise:
151
147
152
148
1. Use the SOLUTION EXPLORER view to expand the project folders.
153
149
154
-
1. Locate and then open the **ConsoleApp.cs** file.
155
-
156
-
The ConsoleApp.cs file is located in the **src/Library.Console** folder.
157
-
158
-
1. Take a moment to review the code file.
150
+
1. Take a moment to review the project files.
159
151
160
-
1. Enter a prompt in the Chat view that generates a description of the **ConsoleApp** class.
152
+
1. Enter a prompt in the Chat view that asks how to publish your codebase to a private GitHub repository.
161
153
162
154
For example, enter the following prompt in the Chat view:
163
155
164
156
```plaintext
165
-
@workspace #usages How is the ConsoleApp class used?
157
+
@github #codebase What's the easiest way to publish my current codebase to a private GitHub repo from within Visual Studio Code?
166
158
```
167
159
168
-
Use chat variables, such as **#usages**, to include specific context in your prompt. To see a list of the chat variables, type **#** in the chat prompt box.
160
+
Use chat participants, such as **@github**, to assign a domain expert foryour prompt. Domain experts help GitHub Copilot generate accurate responses.
169
161
170
162
>**NOTE**: GitHub Copilot considers your chat history and the code files you have open in Visual Studio Code when constructing a context for your prompt and generating a response.
171
163
172
-
1. Take a minute to verify the accuracy of GitHub Copilot's response.
173
-
174
-
You should see a response that the describes where the **ConsoleApp** class is defined and how it's used in the codebase. The ConsoleApp.cs and Program.cs files are referenced in the response, along with line numbers
175
-
176
164
1. Open the **Program.cs** file and examine the code.
177
165
178
166
1. Enter a prompt in the Chat view that generates an explanation of the Program.cs file.
179
167
180
168
For example, enter the following prompt in the Chat view:
181
169
182
170
```plaintext
183
-
@workspace /explain Explain the Program.cs file
171
+
/explain#codebase Explain the Program.cs file
184
172
```
185
173
186
-
Use Slash commands, such as **/explain**, to avoid writing complex prompts forcommon scenarios. To see a list of all available slash commands, type **/**in the chat prompt box. Available slash commands may vary, depending on your environment and the context of your chat.
174
+
Use slash commands, such as **/explain**, to specify the intent of your prompt. Communicating your intent helps GitHub Copilot understand the typeof response that it needs to generate. The list of available slash commands may vary depending on your environment and the context of your chat.
187
175
188
176
1. Take a minute to review the detailed response generated by GitHub Copilot.
189
177
@@ -193,28 +181,26 @@ Use the following steps to complete this section of the exercise:
193
181
194
182
### Improve chat responses by adding context
195
183
196
-
GitHub Copilot uses context to generate more relevant responses.
184
+
GitHub Copilot uses context to generate relevant responses.
197
185
198
-
Opening files in the code editor is one way to establish context, but you can also add files to the Chat context using drag-and-drop operations or by using the **Attach Context** button in the Chat view.
186
+
Opening files in the code editor is one way to establish context, but you can also add files to the Chat context using drag-and-drop operations or by using the **Add Context** button in the Chat view.
199
187
200
188
Use the following steps to complete this section of the exercise:
201
189
202
190
1. Expand the **Library.Infrastructure** project, and then expand the **Data** folder.
203
191
204
192
1. Use a drag-and-drop operation to add the following files from the SOLUTION EXPLORER view to the Chat context: **JsonData.cs**, **JsonLoanRepository.cs**, and **JsonPatronRepository.cs**.
205
193
206
-
GitHub Copilot uses the Chat Context to understand the code files that are relevant to your prompt. You can add files to the Chat context using drag-and-drop operations, or you can use the **Attach Context** button in the Chat view.
207
-
208
-
Instead of adding individual files manually, you can let Copilot find the right files from your codebase automatically. This can be useful when you don't know which files are relevant to your question.
194
+
GitHub Copilot uses the Chat context to understand the code files that are relevant to your prompt. You can add files to the Chat context using drag-and-drop operations, or you can use the **Add Context** button in the Chat view.
209
195
210
-
To let Copilot find the right files automatically, add #codebase in your prompt or select Codebase from the list of context types.
196
+
Instead of adding individual files manually, you can let Copilot find the right files from your codebase. This approach can be useful when you don't know which files are relevant to your question, but it does slow down the response time. To let Copilot find the right files automatically, add #codebase in your prompt.
211
197
212
198
1. Enter a prompt in the Chat view that generates an explanation of the data access classes.
213
199
214
200
For example, enter the following prompt in the Chat view:
215
201
216
202
```plaintext
217
-
@workspace /explain Explain how the data access classes work
203
+
/explain Explain how the data access classes work
218
204
```
219
205
220
206
1. Take a couple minutes to read through the response.
@@ -237,7 +223,7 @@ Use the following steps to complete this section of the exercise:
237
223
238
224
1. Ensure that you have the **Solution Explorer** view open.
239
225
240
-
The Solution Explorer view is not the same as the Explorer view. The Solution Explorer view uses project and solution files as "directory" nodes to display the structure of the solution.
226
+
The Solution Explorer is a dedicated view added to Visual Studio Code's primary sidebar by the C# Dev Kit extension. It provides a structured, solution-centric view of your .NET application that's similar to the Solution Explorer in the Visual Studio IDE. It's more informative and organized than the plain folder/file tree that the built-in Explorer view.
241
227
242
228
1. To run the application, right-click **Library.Console**, select**Debug**, and thenselect**Start New Instance**.
243
229
@@ -302,13 +288,13 @@ Use the following steps to complete this section of the exercise:
302
288
303
289
1. Add a new file named **README.md** to the root folder of the **AccelerateDevGHCopilot** solution.
304
290
305
-
1. Open the Chat view.
291
+
1. Open the Chat view, and selectthe**Ask** agent mode.
306
292
307
293
1. To generate project documentation for your README file, enter the following prompt:
308
294
309
295
```plaintext
310
296
311
-
@workspace Generate the contents of a README.md file for a code repository. Use "Library App" as the project title. The README file should include the following sections: Description, Project Structure, Key Classes and Interfaces, Usage, License. Format all sections as raw markdown. Use a bullet list with indents to represent the project structure. Do not include ".gitignore" or the ".github", "bin", and "obj" folders.
297
+
#codebase I need you to generate the contents of a README.md file that I can use for the current code repository. Use "Library App" as the project title. The README file should include the following sections: Description, Project Structure, Key Classes and Interfaces, Usage, License. Format all sections as raw markdown. Use a bullet list with indents to represent the project structure. Do not include ".gitignore" or the ".github", "bin", and "obj" folders. I want add the suggested content to the README.md file that's open in the editor.
0 commit comments