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: README.md
+25-17
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,18 @@ _GitHub Copilot can help you code by offering autocomplete-style suggestions rig
16
16
</header>
17
17
18
18
<!--
19
-
<<< Author notes: Step 3 >>>
19
+
<<< Author notes: Step 4 >>>
20
20
Start this step by acknowledging the previous step.
21
21
Define terms and link to docs.github.com.
22
22
-->
23
23
24
-
## Step 3: View the GitHub Copilot tab with multiple suggestions
24
+
## Step 4: Using comments to generate code with Copilot
25
25
26
-
_Nice work! You just used AI code suggestions within a Javascript file by using GitHub Copilot :sparkles:_
26
+
_Nicely done utilizing the Copilot tab!_:partying_face:
27
27
28
-
Keep in mind that as you continue to use copilot, you may not want some of the suggestions GitHub Copilot offers. GitHub Copilot will show you multiple suggestions in a new tab.
28
+
You now have leveraged the Copilot quick tab auto-suggest as well as the Copilot hub to accept AI generated suggestions.
29
+
30
+
Now lets see how you can leverage comments to generate Copilot suggestions!
29
31
30
32
### :keyboard: Activity: Pull the latest code to the Codespace repo.
31
33
@@ -38,32 +40,38 @@ Keep in mind that as you continue to use copilot, you may not want some of the s
38
40
git pull
39
41
```
40
42
41
-
### :keyboard: Activity: Add another Javascript method and view all suggestions
43
+
### :keyboard: Activity: Generate Copilot suggested code from comments.
42
44
43
-
1. From inside the codespace in the VS Code explorer window, create a new file. Note: If you closed the Codespace from above please open it back up or create a new Codespace.
44
-
2. Name the file `member.js`
45
-
3.In the `member.js` file, type the following function header.
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:
46
48
```
47
-
function skillsMember()
49
+
// Create web server
48
50
```
49
-
4. Stop typing and view the Copilot suggestion by hovering over the red squiggly and select the `...`
50
-
5. Click `Open Completions Panel`. Copilot will synthesize around 10 different code suggestions. You should see something like this:
51
-

52
-
6. Find a solution you like and click `Accept Solution`.
53
-
7. Your `member.js` file will be updated with your solution.
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.
54
62
55
63
### :keyboard: Activity: Push code to your repository from the codespace
56
64
57
-
1. Use the VS Code terminal to add the `member.js` file to the repository:
65
+
1. Use the VS Code terminal to add the `comments.js` file to the repository:
58
66
59
67
```
60
-
git add member.js
68
+
git add comments.js
61
69
```
62
70
63
71
2. Next from the VS Code terminal stage and commit the changes to the repository:
64
72
65
73
```
66
-
git commit -m "Copilot second commit"
74
+
git commit -m "Copilot third commit"
67
75
```
68
76
69
77
3. Finally from the VS Code terminal push to code to the repository:
0 commit comments