Skip to content

Commit 8d630e3

Browse files
docs: Add additional explanations and screenshots to steps (#2)
* chore: add *.temp* to .gitignore to exclude temporary files * fix: clarify instructions for creating a Codespace with default configuration * fix: update Python version in devcontainer configuration to 3.13 * docs: update instructions for using Copilot Chat with codebase explanation * feat: add port forwarding for development server in devcontainer configuration * docs: Add additional explanations/screenshots to step1 * docs: Update comment, add ports screenshot to step 1 * docs: add example suggestion for Copilot usage in introduction step * docs: Add extra documentation and screenshots for step 2 * docs: Update docs for step3 with screenshots
1 parent e2e0991 commit 8d630e3

File tree

5 files changed

+66
-19
lines changed

5 files changed

+66
-19
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"name": "Python 3",
3-
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.9",
4-
"features": {
5-
"ghcr.io/devcontainers/features/python:1": {
6-
"version": "3.13"
7-
}
8-
},
3+
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.13",
4+
"forwardPorts": [8000],
95
"postCreateCommand": "pip install -r requirements.txt",
106
"customizations": {
117
"vscode": {

.github/steps/1-preparing.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ GitHub Copilot has been proven to increase developer productivity and accelerate
1414

1515
### :keyboard: Activity: Getting to know basic Copilot features :robot:
1616

17-
1. Right-click the below button to open the **Create Codespace** page in a new tab.
17+
1. Right-click the below button to open the **Create Codespace** page in a new tab. Use the default configuration.
1818

1919
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/{{full_repo_name}}?quickstart=1)
2020

21-
- The free tier of Codespaces that comes with all GitHub accounts is fine, assuming you still have minutes available.
22-
- The default Codespace settings are fine.
23-
- This repository will provide the additional settings and files for making your extension.
24-
2521
1. Confirm the **Repository** field is your copy of the exercise, not the original, then click the green **Create Codespace** button.
2622

2723
- ✅ Your copy: `/{{{full_repo_name}}}`
@@ -31,18 +27,29 @@ GitHub Copilot has been proven to increase developer productivity and accelerate
3127

3228
1. Click the extensions sidebar tab and verify that `GitHub Copilot` extension is installed.
3329

34-
<!-- TODO: Add screenshot -->
30+
![image](https://github.com/user-attachments/assets/c1ddca93-723d-4c62-a309-5944e5dfc6f4)
31+
3532

3633
1. Search for the Copilot Icon on the top right section of your editor.
37-
Open up Copilot Chat and ask Copilot to introduce you to the project, to do that type `/explain` in the Chat Window.
38-
<!-- TODO: Add screenshot -->
39-
1. Run the project by using `Run and Debug` section in the left sidebar of VS Code. Then head to the ports tab and open the application available on port 8000
34+
Open up Copilot Chat and ask Copilot to introduce you to the project.
35+
36+
```txt
37+
@workspace Briefly explain the structure of the codebase in this repository.
38+
```
39+
40+
1. Run the project by using `Run and Debug` section in the left sidebar of VS Code.
41+
42+
<img width="300" alt="image" src="https://github.com/user-attachments/assets/50b27f2a-5eab-4827-9343-ab5bce62357e" />
43+
44+
45+
1. Then head to the ports tab and open the application available on port `8000`
46+
47+
![image](https://github.com/user-attachments/assets/92d5642e-ce99-4a66-850c-2d311a673596)
4048

41-
<!-- TODO: Add screenshot -->
4249

4350
1. Great! Now that you know what we will be working with, let's have your first interaction with Copilot.
4451

45-
Open up a terminal in VS Code so you won't interrupt the debug session you just started.
52+
Open up a terminal a new terminal window in VS Code so you won't interrupt the debug session you just started in the current one.
4653

4754
Next, `Right click` within the newly created terminal window, then click `Copilot` => `Terminal Inline Chat`.
4855

.github/steps/2-first-introduction.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ There are many Copilot Features and interaction modes. In this step you will get
2626

2727
Press `Tab` to accept your first Copilot suggestion :tada: :robot:
2828

29+
30+
<details>
31+
<summary>Example suggestion</summary><br/>
32+
33+
```python
34+
@app.post("/activities/{activity_name}/signup")
35+
def signup_for_activity(activity_name: str, email: str):
36+
"""Sign up a student for an activity"""
37+
# Validate activity exists
38+
if activity_name not in activities:
39+
raise HTTPException(status_code=404, detail="Activity not found")
40+
41+
# Validate student is not already signed
42+
if email in activities[activity_name]["participants"]:
43+
raise HTTPException(status_code=400, detail="Student is already signed up")
44+
45+
activity = activities[activity_name]
46+
47+
# Add student
48+
activity["participants"].append(email)
49+
return {"message": f"Signed up {email} for {activity_name}"}
50+
```
51+
</details>
52+
2953
> **TIP**: If you would like to see other suggestions, instead of pressing `Tab`, hover over the suggestion and a small panel will show up. On it's right side click the three dots `...` and select `Open Completions Panel`
3054
3155

@@ -36,6 +60,7 @@ There are many Copilot Features and interaction modes. In this step you will get
3660
```
3761

3862
On the bottom part of Copilot Chat you can choose what AI Model Copilot should use. Different models can provide different results.
63+
![image](https://github.com/user-attachments/assets/2668c5f8-1f28-4361-bf07-0b67d6a4e7c4)
3964

4065
1. You can use Copilot Chat inline to stay in the flow. It's often used when you are dealing with problems or want to understand a specific part of the code.
4166

@@ -54,6 +79,9 @@ There are many Copilot Features and interaction modes. In this step you will get
5479
1. On the right side of the commit message window click :sparkles: to generate commit message with copilot
5580
1. Commit and sync your changes with the automatically generated message
5681

82+
![image](https://github.com/user-attachments/assets/7d3daf4e-4125-4775-88a7-33251cd7293e)
83+
84+
5785
1. Wait a moment for the bot to check your work. You will see a comment with progress info and the next lesson.
5886

5987
<details>

.github/steps/3-copilot-edits.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222

2323
### :keyboard: Activity: Let's add a feature!
2424

25-
1. In the top left part of Copilot Chat window, switch the Copilot Edits.
25+
1. In the top left part of Copilot Chat window, switch to Copilot Edits.
26+
27+
![image](https://github.com/user-attachments/assets/0b17c5bd-d03b-41b1-b97d-624fcbf8ccd1)
28+
2629
1. Add the following files to the working set. Use the attach button in the bottom left corner of Copilot Edits view.
2730
- `src/static/app.js`
2831
- `src/static/index.html`
@@ -35,7 +38,18 @@
3538
3639
Copilot will generate inline edits for you. You can accept them or if this wasn't what you were hoping for, provide Copilot additional instructions.
3740
38-
> **TIP:** On the bottom part of Copilot Edits you can choose what AI Model Copilot should use. Different models can provide different results.
41+
> **TIP:** On the bottom part of Copilot Edits you can choose what AI Model Copilot should use. Different models can provide different results.
42+
43+
<details>
44+
<summary>Having trouble? 🤷</summary><br/>
45+
46+
Remember, to add the relevant files to the working set.
47+
48+
49+
![image](https://github.com/user-attachments/assets/bdd7318b-50e3-46d0-88ce-7615f45ce334)
50+
51+
52+
</details>
3953
4054
1. Head back to the website and see your changes!
4155
<details>

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.temp*
2+
13
# Compiled source #
24
###################
35
*.com

0 commit comments

Comments
 (0)