Skip to content

Commit 694ab54

Browse files
committed
Add settings for cSpell and update README.md for clarity and structure
- Introduced a new settings.json file for cSpell configuration. - Revised section titles and content in README.md to enhance clarity. - Added images for better visual guidance in the README.
1 parent 435f3df commit 694ab54

File tree

4 files changed

+36
-21
lines changed

4 files changed

+36
-21
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"Blazor"
4+
]
5+
}

Using-GitHub-Copilot-with-CSharp/README.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The "**GitHub Codespaces ♥️ .NET 8**" repository builds a Weather API using
4343
We will review the steps to update the Weather BackEnd App by adding a new endpoint that requests a specific location and returns the weather forecast for that location.
4444

4545

46-
### 🗒️ Section 1: Code Completion
46+
### 🗒️ Section 1: Exploring Your Project
4747

4848
🎯**Learning Goals**
4949
- Use inline code completion to scaffold new classes and methods
@@ -54,64 +54,73 @@ Once your Codespace launches, you'll have a fully functional development environ
5454

5555
To get started:
5656

57-
1. Click the Copilot Chat icon in the top-right corner of the Codespace window
58-
![Open GitHub Copilot Chat](./001-chat.jpg001-chat.jpg)
57+
1. Click the Copilot Chat icon in the top-right corner of the Codespace window:
58+
59+
<div align="left">
60+
<img src="./images/001-chat.jpg" alt="Open GitHub Copilot Chat" width="500" height="300">
61+
</div>
5962

6063
2. Instead of manually exploring the BackEnd and Front folders, try asking Copilot for an overview. In the chat pane, type '/' to view available slash commands — these offer quick, structured ways to interact with Copilot.
61-
Type '/help' to see all commands, or check out the {GitHub Copilot Chat cheat sheet for a list of slash commands](https://docs.github.com/copilot/reference/github-copilot-chat-cheat-sheet#slash-commands) available.
62-
For example, you can use:
63-
- `/doc` to add a documentation comment
64-
- `/explain` to explain the code
65-
- `/fix` to propose a fix for the problems in the selected code
66-
- `/generate` to generate code to answer your question
6764

68-
3. In lieu of using natural language, type in '/explain' into the chat pane. The output from GitHub Copilot will go into details of how the project is structured, including further information of the Frontend and Backend details.
65+
Type `/help` to see all commands, or check out the [GitHub Copilot Chat cheat sheet](https://docs.github.com/copilot/reference/github-copilot-chat-cheat-sheet#slash-commands) for a list of available slash commands.
66+
67+
For example, you can use:
68+
- `/doc` to add a documentation comment
69+
- `/explain` to explain the code
70+
- `/fix` to propose a fix for the problems in the selected code
71+
- `/generate` to generate code to answer your question
72+
73+
3. In lieu of using natural language, type `/explain` into the chat pane. The output from GitHub Copilot will go into details of how the project is structured, including further information of the Frontend and Backend details.
6974

70-
TODO: Add gif/jpg of output
75+
<div align="left">
76+
<img src="./images/002explainoutput.gif" alt="Output of /Explain" width="500" height="300">
77+
</div>
7178

7279
4. As a visual learner, you can ask GitHub Copilot to create a diagram of the workflow of the application. This could be saved into a README for further documentation.
7380

7481
TODO: Add gif/jpg of flow
7582

76-
5. Ask GitHub Copilot in the chat pane to "run and debug" the backend project (you can also do this from the 'run and debug' panel in the editor). Copilot will debug the selected project, showing the running port 8080. Copilot will give you the url to the website (selecting the 'ports' tab in the terminal will also output the url). When selecting the published url ensure that the '/weatherforecast' endpoint is named. This should produce a successfully test displaying the running application.
83+
### 🗒️ Section 2: Code Completion
84+
85+
1. Ask GitHub Copilot in the chat pane to "run and debug" the backend project (you can also do this from the 'run and debug' panel in the editor). Copilot will debug the selected project, showing the running port 8080. Copilot will give you the url to the website (selecting the 'ports' tab in the terminal will also output the url). When selecting the published url ensure that the '/weatherforecast' endpoint is named. This should produce a successfully test displaying the running application.
7786

7887
TODO: Add gig/jpg
7988

8089
In this section you learned how to use both natural language or slash commands to quickly understand the codebase without digging through folders. In the next set of exercises we're going to use Copilot to create a new class using code completion
8190

82-
6. In order to generate a new record that includes the name of the city, navigates to the following path `SampleApp\BackEnd\Program.cs` and open `Program.cs`. Navigate to the end of the file and type in (or copy):
91+
2. In order to generate a new record that includes the name of the city, navigates to the following path `SampleApp\BackEnd\Program.cs` and open `Program.cs`. Navigate to the end of the file and type in (or copy):
8392

8493
```csharp
8594
// create a new internal record named WeatherForecastByCity that request the following parameters: City, Date, TemperatureC, Summary
8695
```
8796

8897
TODO: show output
8998

90-
7. We can create a new C# class by creating a new file under the 'BackEnd' folder: '/BackEnd/customer.cs'. Press `CTRL + I` to open the inline chat and type in:
99+
3. We can create a new C# class by creating a new file under the 'BackEnd' folder: '/BackEnd/customer.cs'. Press `CTRL + I` to open the inline chat and type in:
91100

92101
```csharp
93102
// Create a class for a Customer with Id, Name, and Email, and a method to validate email format
94103
```
95104

96-
8. Accept the suggestion and using the inline prompt window ask:
105+
4. Accept the suggestion and using the inline prompt window ask:
97106

98107
```csharp
99108
/improve IsValidEmail method using Regex
100109
```
101110

102-
9. You can further highlight the method and ask inline (or select `CTRL + Shift + I`) to open chat and ask Copilot 'Explain what IsValidEmail() does'
111+
5. You can further highlight the method and ask inline (or select `CTRL + Shift + I`) to open chat and ask Copilot 'Explain what IsValidEmail() does'
103112

104-
10. While Inline suggestions are great at autocompleting a section of code, we often need help with multiple edits. Copilot next edit suggestions will predict the location of the next edit and what that edit should be. In this task we will implement a simple endpoint for retrieving and creating customers.
113+
6. While Inline suggestions are great at autocompleting a section of code, we often need help with multiple edits. Copilot next edit suggestions will predict the location of the next edit and what that edit should be. In this task we will implement a simple endpoint for retrieving and creating customers.
105114

106-
TODO: Can't get recording of next edits on this file :(
115+
TODO: NES
107116

108117
In the above exercises we achieved the following:
109118
- ✅ Generated suggestions from code comments
110119
- ✅ Used inline chat and slash to generate new code, query code and accept coding suggestions
111120
- ✅ Trigger and refine Copilot suggestions
112121

113122

114-
### 📄Section 2: GitHub Copilot Agent Mode
123+
### 📄Section 3: GitHub Copilot Agent Mode
115124

116125
🎯**Learning Goals**
117126
- Observe autonomous coding and PR generation
@@ -179,13 +188,14 @@ Agent Mode was able to perform C# specific tasks:
179188
- ✅ Implementing comprehensive error handling
180189
- ✅ Setting up dependency injection for better testability
181190
- ✅ Creating an organized project structure
182-
-
183-
### 🗒️ Section 3: Customization and Context
191+
192+
### 🗒️ Section 4: Customization and Context
184193

185194
TODO
186195

187196
### Useful Links and Further Learning
188197
- [Use agent mode in VS Code](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode)
198+
- [GitHub Copilot Chat Cheat Sheet](https://docs.github.com/copilot/reference/github-copilot-chat-cheat-sheet)
189199
190200
## Legal Notices
191201

File renamed without changes.
29.1 MB
Loading

0 commit comments

Comments
 (0)