Skip to content

Commit ad9a7d2

Browse files
Merge pull request #6 from microsoft/edits-march4th
Add commits, chats, and edits
2 parents d65f7c3 + 92758c8 commit ad9a7d2

File tree

10 files changed

+58
-46
lines changed

10 files changed

+58
-46
lines changed

Diff for: 03-Introduction-to-GitHub-Copilot/steps/2-skills-dotnet.md

+10-15
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,20 @@ GitHub Copilot provides suggestions for numerous languages and a wide variety of
66

77
Let's try this out utilizing C# for Copilot.
88

9+
> **Note**:
10+
> If you closed the Codespace from above, please open it back up or create a new Codespace.
11+
912
### ⌨️ Activity: Add a C# file and start writing code
1013

1114
> **Note**:
12-
> If you closed the Codespace from above, please open it back up or create a new Codespace.
15+
> Make sure to open the **Solution Explorer** to see an organized view to easily add new projects and run them..
1316
1417
1. Create a new .NET project by using the `.NET: New Project...` command and selecting `Console App`.
1518
1. Select the **code** folder and name the project **Skills**.
1619
1. Open `Program.cs`
1720
1. Verify your new file looks like:
1821
![VS code with a new Program.cs](./img/2-skills-dotnet-0.png)
22+
1923
1. In the `Program.cs` file, remove any code and then type the following function header.
2024

2125
```csharp
@@ -30,23 +34,14 @@ Let's try this out utilizing C# for Copilot.
3034

3135
### ⌨️ Activity: Push code to your repository from the codespace
3236

33-
1. Use the VS Code terminal to add all files to the repository:
37+
Let's use GitHub Copilot to summarize our changes and then commit the code.
3438

35-
```
36-
git add -A
37-
```
39+
1. Open the **Source Control** tab
40+
2. Tap on thebutton in the **Message** entry for Copilot to generate your message.
3841

39-
2. Next from the VS Code terminal stage and commit the changes to the repository:
42+
![Commit tab open to generate message with Copilot](img/2-skills-commit.png)
4043

41-
```
42-
git commit -m "Copilot first commit"
43-
```
44-
45-
3. Finally from the VS Code terminal push to code to the repository:
46-
47-
```
48-
git push
49-
```
44+
3. Click the **Commit** button.
5045

5146

5247
Head to [Part 3 of the Exercise](./3-copilot-hub.md)

Diff for: 03-Introduction-to-GitHub-Copilot/steps/3-copilot-hub.md

+5-14
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,14 @@ Keep in mind that as you continue to use copilot, you may not want some of the s
2828

2929
### ⌨️ Activity: Push code to your repository from the codespace
3030

31-
1. Use the VS Code terminal to add the `Member.cs` file to the repository:
31+
Let's use GitHub Copilot to summarize our changes and then commit the code.
3232

33-
```
34-
git add Member.cs
35-
```
36-
37-
2. Next from the VS Code terminal stage and commit the changes to the repository:
38-
39-
```
40-
git commit -m "Copilot second commit"
41-
```
33+
1. Open the **Source Control** tab
34+
2. Tap on the ✨ button in the **Message** entry for Copilot to generate your message.
4235

43-
3. Finally from the VS Code terminal push to code to the repository:
36+
![Commit tab open to generate message with Copilot](img/2-skills-commit.png)
4437

45-
```
46-
git push
47-
```
38+
3. Click the **Commit** button.
4839

4940

5041
Head to [Part 4 of the Exercise](./4-copilot-comment.md)

Diff for: 03-Introduction-to-GitHub-Copilot/steps/4-copilot-comment.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,13 @@ Now lets see how you can leverage comments to generate Copilot suggestions!
3131

3232
### ⌨️ Activity: Push code to your repository from the codespace
3333

34-
1. Use the VS Code terminal to add the `Comments.cs` file to the repository:
34+
Let's use GitHub Copilot to summarize our changes and then commit the code.
3535

36-
```
37-
git add Comments.cs
38-
```
39-
40-
2. Next from the VS Code terminal stage and commit the changes to the repository:
36+
1. Open the **Source Control** tab
37+
2. Tap on the ✨ button in the **Message** entry for Copilot to generate your message.
4138

42-
```
43-
git commit -m "Copilot third commit"
44-
```
39+
![Commit tab open to generate message with Copilot](img/2-skills-commit.png)
4540

46-
3. Finally from the VS Code terminal push to code to the repository:
41+
3. Click the **Commit** button.
4742

48-
```
49-
git push
50-
```
43+
Head to [Exercise 4 - Using GitHub Copilot with C#](../../04-Using-GitHub-Copilot-with-CSharp/README.md)
Loading

Diff for: 04-Using-GitHub-Copilot-with-CSharp/README.md

+37-3
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,27 @@ The "**GitHub Codespaces ♥️ .NET**" repository builds a Weather API using Mi
4545
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.
4646

4747

48-
### 🗒️ Step 1: Get familiarized with the "GitHub Codespaces ♥️ .NET" repository
48+
### 🤔 Step 0: Get familiarized with the "GitHub Codespaces ♥️ .NET" repository
4949

5050
Once you open the repository in Codespaces, you will find a new browser window with a fully functional Codespace. Everything in this repository is contained within this one Codespace. In example, in the explorer panel, we can see the main code for the BackEnd and the FrontEnd project.
5151

5252
![new Codespace with all the repository running](./images/005OpenRepoInCodeSpaces.png)
5353

54+
Before we run the project, let's use GitHub Copilot Chat to inquire about what the project is and the different components.
55+
56+
1. Open **GitHub Copilot Chat** from the main navigation bar.
57+
1. Type in `What is this project doing, and what are the key components?` and hit **Send***
58+
59+
GitHub Copilot Chat will now look at the entire project and give us a summary of what the projects do, what technology they use, and any of the key components in them.
60+
61+
![Copilot Chat describing the project](./images/004AskCopilotAboutProject.png)
62+
63+
From here, you can click on files to navigate to them and you can ask follow up questions such as `What APIs are available?`.
64+
65+
66+
### 🚀 Step 1: Run the projects
67+
68+
Now that we have context of what is in the project, let's run it and see it in action.
5469
In order to run the BackEnd project, go to the "Run and Debug" panel, and select the "BackEnd" Project.
5570

5671
![open program.cs in the BackEnd project](./images/006RunBackEndProject.png)
@@ -82,7 +97,6 @@ Pressing F10 we can debug step-by-step until line 32, where we can see the gener
8297

8398
You can stop debugging now.
8499

85-
86100
Congratulations! Now you are ready to add more features into the app using GitHub Copilot.
87101

88102
### 🗒️ Step 2: Get familiarized with GitHub Copilot Slash Commands
@@ -95,7 +109,6 @@ Now let's use a slash command, in GitHub Copilot to understand a piece of code.
95109

96110
![Use slash command to explain a piece of code](./images/011SlashCommandExplain.gif)
97111

98-
99112
Based on your version of GitHub Copilot you will see either an inline response or an update in the Chat Panel. GitHub Copilot will create a detailed explanation of the selected code. A summarized version will be like this one:
100113

101114
```
@@ -218,6 +231,27 @@ Both tests running should be like these ones:
218231

219232
🚀 Congratulations, through the exercise, you haven't only used GitHub Copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
220233

234+
### ✨ Bonus: Add new capabilities with GitHub Copilot Edits
235+
236+
Let's use **Copilot Edits** to start an AI-powered code editing session and iterate quickly on code changes across multiple files by using natural language. Copilot Edits applies the edits directly in the editor, where you can review them in-place, with the full context of the surrounding code.
237+
238+
Let's add some new functionality so the user can enter the city they want to search for and call our new API.
239+
240+
1. Open the **Edits** mode window in GitHub Copilot Chat
241+
242+
![Selecting **Edits** mode](./images/OpenEditsWindows.png)
243+
2. Select the **+Add Files...** button from the Edits window and add **FetchData.razor** and **WeatherForecastClient.cs**.
244+
3. Enter into the chat: `Update the user interface to ask the user the city they want the weather for, use the forecast client to call the new endpoint for the city, and update the table to display the city as well.
245+
4. Select the **Send** button and now Edits will generate an iteration plan for the changes.
246+
5. Review the edits and hit **Accept** in the edits window to accept all changes to files.
247+
6. Run the application
248+
249+
> Note: If the application doesn't run or it doesn't call the new endpoint, validate the changes in the files changed and ensure the endpoint is being called correctly.
250+
251+
![Image of the weather page with city entry](./images/WeatherWithEdits.png)
252+
253+
From here, you can continue to iterate and ask questions about styling or other pieces of functionality to add to the application.
254+
221255

222256
## Legal Notices
223257

Loading
Loading
15.7 KB
Loading
Loading

Diff for: 04-Using-GitHub-Copilot-with-CSharp/images/test.md

-1
This file was deleted.

0 commit comments

Comments
 (0)