GitHub Copilot can help you code by offering autocomplete-style suggestions right in VS Code and Codespaces.
Nice work! You just used AI code suggestions within a Javascript file by using GitHub Copilot ✨
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.
Note Pull MUST be done prior to the next activity.
-
Use the VS Code terminal to pull the latest code:
git pull
- 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.
- Name the file
member.js
- In the
member.js
file, type the following function header.function skillsMember()
- Stop typing and view the Copilot suggestion by hovering over the red squiggly and select the
...
- Click
Open Completions Panel
. Copilot will synthesize around 10 different code suggestions. You should see something like this: - Find a solution you like and click
Accept Solution
. - Your
member.js
file will be updated with your solution.
-
Use the VS Code terminal to add the
member.js
file to the repository:git add member.js
-
Next from the VS Code terminal stage and commit the changes to the repository:
git commit -m "Copilot second commit"
-
Finally from the VS Code terminal push to code to the repository:
git push
Wait about 60 seconds then refresh your repository landing page for the next step.
Get help: Post in our discussion board • Review the GitHub status page
© 2023 GitHub • Code of Conduct • MIT License