Update to 4 in STEP and README.md

This commit is contained in:
github-actions
2023-12-19 14:46:38 +00:00
parent 4765c801f2
commit 93308c89b0
2 changed files with 26 additions and 18 deletions
+1 -1
View File
@@ -1 +1 @@
3 4
+25 -17
View File
@@ -16,16 +16,18 @@ _GitHub Copilot can help you code by offering autocomplete-style suggestions rig
</header> </header>
<!-- <!--
<<< Author notes: Step 3 >>> <<< Author notes: Step 4 >>>
Start this step by acknowledging the previous step. Start this step by acknowledging the previous step.
Define terms and link to docs.github.com. Define terms and link to docs.github.com.
--> -->
## Step 3: View the GitHub Copilot tab with multiple suggestions ## Step 4: Using comments to generate code with Copilot
_Nice work! You just used AI code suggestions within a Javascript file by using GitHub Copilot :sparkles:_ _Nicely done utilizing the Copilot tab!_ :partying_face:
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. You now have leveraged the Copilot quick tab auto-suggest as well as the Copilot hub to accept AI generated suggestions.
Now lets see how you can leverage comments to generate Copilot suggestions!
### :keyboard: Activity: Pull the latest code to the Codespace repo. ### :keyboard: Activity: Pull the latest code to the Codespace repo.
@@ -38,32 +40,38 @@ Keep in mind that as you continue to use copilot, you may not want some of the s
git pull git pull
``` ```
### :keyboard: Activity: Add another Javascript method and view all suggestions ### :keyboard: Activity: Generate Copilot suggested code from comments.
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. 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.)
2. Name the file `member.js` 2. Name the file `comments.js`.
3. In the `member.js` file, type the following function header. 3. Type the following comment into the file:
``` ```
function skillsMember() // Create web server
``` ```
4. Stop typing and view the Copilot suggestion by hovering over the red squiggly and select the `...` 4. Press `enter` to go to a new line.
5. Click `Open Completions Panel`. Copilot will synthesize around 10 different code suggestions. You should see something like this: 5. Copilot will suggest a code block.
![Screen Shot 2023-04-27 at 10 06 55 AM](https://user-images.githubusercontent.com/26442605/234937592-d196bd5e-8ac2-4d9a-87f4-94e8a9b6a417.png) 6. Hover over the red squggly and select the `...`
6. Find a solution you like and click `Accept Solution`.
7. Your `member.js` file will be updated with your solution. > **Note**
> 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.
7. Click `Open Completions Panel`. Copilot will synthesise around 10 different code suggestions. You should see something like this:
![Screen Shot 2023-04-25 at 3 59 42 PM](https://user-images.githubusercontent.com/26442605/234425509-74ea96e0-bbd6-417b-84c5-73546ac7b2cd.png)
8. Find a solution you like and click `Accept Solution`.
9. Your `comments.js` file will be updated with your solution.
### :keyboard: Activity: Push code to your repository from the codespace ### :keyboard: Activity: Push code to your repository from the codespace
1. Use the VS Code terminal to add the `member.js` file to the repository: 1. Use the VS Code terminal to add the `comments.js` file to the repository:
``` ```
git add member.js git add comments.js
``` ```
2. Next from the VS Code terminal stage and commit the changes to the repository: 2. Next from the VS Code terminal stage and commit the changes to the repository:
``` ```
git commit -m "Copilot second commit" git commit -m "Copilot third commit"
``` ```
3. Finally from the VS Code terminal push to code to the repository: 3. Finally from the VS Code terminal push to code to the repository: