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
Now lets see how you can leverage comments to generate Copilot suggestions!
29
+
Here's a recap of all the tasks you completed:
31
30
32
-
### :keyboard: Activity: Pull the latest code to the Codespace repo.
31
+
- Set up Copilot inside a Codespace.
32
+
- Use Copilot to accept suggested code.
33
+
- Use Copilot's hub for alternate suggestions.
34
+
- Leverage comments to have Copilot auto-suggest code.
33
35
34
-
> **Note**
35
-
> Pull MUST be done prior to the next activity.
36
+
### Additional learning and resources
36
37
37
-
1. Use the VS Code terminal to pull the latest code:
38
+
-[Copilot for Individuals](https://docs.github.com/en/copilot/overview-of-github-copilot/about-github-copilot-for-individuals)
39
+
-[Copilot for Business](https://docs.github.com/en/copilot/overview-of-github-copilot/about-github-copilot-for-business)
40
+
-[Getting started with Copilot](https://docs.github.com/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code)
### :keyboard: Activity: Generate Copilot suggested code from comments.
44
-
45
-
1. From inside the codespace in the VS Code explorer window, create a new file. (If you closed the Codespace from above, please open it back up or create a new Codespace.)
46
-
2. Name the file `comments.js`.
47
-
3. Type the following comment into the file:
48
-
```
49
-
// Create web server
50
-
```
51
-
4. Press `enter` to go to a new line.
52
-
5. Copilot will suggest a code block.
53
-
6. Hover over the red squiggly and select the `...`
54
-
55
-
> **Note**
56
-
> If you don't see the copilot code block suggestion or the red squiggly and the three dots `...`, you can type `control + enter` to bring up the GitHub Copilot completions panel.
57
-
58
-
7. Click `Open Completions Panel`. Copilot will synthesise around 10 different code suggestions. You should see something like this:
59
-

60
-
8. Find a solution you like and click `Accept Solution`.
61
-
9. Your `comments.js` file will be updated with your solution.
62
-
63
-
### :keyboard: Activity: Push code to your repository from the codespace
64
-
65
-
1. Use the VS Code terminal to add the `comments.js` file to the repository:
66
-
67
-
```
68
-
git add comments.js
69
-
```
70
-
71
-
2. Next from the VS Code terminal stage and commit the changes to the repository:
72
-
73
-
```
74
-
git commit -m "Copilot third commit"
75
-
```
76
-
77
-
3. Finally from the VS Code terminal push to code to the repository:
78
-
79
-
```
80
-
git push
81
-
```
82
-
83
-
**Wait about 60 seconds then refresh your repository landing page for the next step.**
45
+
-[We'd love to hear what you thought of this course](https://github.com/orgs/skills/discussions/categories/code-with-copilot).
46
+
-[Learn another GitHub skill](https://github.com/skills).
47
+
-[Read the Get started with GitHub docs](https://docs.github.com/en/get-started).
48
+
- To find projects to contribute to, check out [GitHub Explore](https://github.com/explore).
0 commit comments