Nicely done utilizing the Copilot 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!
- From inside the codespace in the Solution Explorer, right click on the project, create a new file.
Note: If you closed the Codespace from above please open it back up or create a new Codespace.
-
Select Class and name the file
Comments.cs
-
Type the following comment into the file inside of the Comments class:
// create a method that generates a comment for a given skill
-
Press
enter
to go to a new line. -
Copilot will suggest a code block.
-
Hover over the red squiggly and select the
...
Note If you don't see the copilot code block suggestion or the red squiggly and the three dots
...
, you can typecontrol + enter
to bring up the GitHub Copilot completions panel. -
Click
Open Completions Panel
. Copilot will synthesise around 10 different code suggestions. You should see something like this: -
Find a solution you like and click
Accept Solution
. -
Your
Comments.cs
file will be updated with your solution.
Let's use GitHub Copilot to summarize our changes and then commit the code.
- Open the Source Control tab
- Tap on the ✨ button in the Message entry for Copilot to generate your message.
- Click the Commit button.