Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.85 KB

File metadata and controls

41 lines (26 loc) · 1.85 KB

Step 3: View the GitHub Copilot tab with multiple suggestions

Nice work! You just used AI code suggestions within a C# 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.

⌨️ Activity: Add another C# method and view all suggestions

  1. 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.

  1. Select Class and name the file Members.cs

  2. In the Members.cs file, type the following function inside of the Member class.

    public strin
    
  3. Stop typing and view the Copilot suggestion by hovering over end the red squiggly grat text and select the ...

  4. Click Open Completions Panel.

    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.

  5. Copilot will synthesize around 10 different code suggestions or press CTRL+Enter. You should see something like this: VS Code showing pop up with Completions Panel

  6. Find a solution you like and click Accept Solution.

  7. Your Member.cs file will be updated with your solution.

⌨️ Activity: Push code to your repository from the codespace

Let's use GitHub Copilot to summarize our changes and then commit the code.

  1. Open the Source Control tab
  2. Tap on the ✨ button in the Message entry for Copilot to generate your message.

Commit tab open to generate message with Copilot

  1. Click the Commit button.

Head to Part 4 of the Exercise