Install and Use GitHub Copilot in Visual Studio

In this GitHub Copilot blog post, we will show how to install and use Copilot in Visual Studio.

In our previous post on GitHub Copilot, we explained and showed how you can get started with GitHub Copilot. This post is an extension of the original post.

Add a GitHub Account to Visual Studio

Before you start using Copilot with VS, you must add your GitHub account to VS for Copilot to work and use your license. To add your GitHub account to Copilot use the following steps.

  1. Click on File
  2. Click on Account Settings
  3. Click Add and select GitHub

Install Extensions

Once your account is set, install the following two GitHub Copilot extensions:

  • GitHub Copilot
  • GitHub Copilot Chat

To install the extensions.

  1. Click on Extensions
  2. Select Manage Extensions

Click on Download next to the two extensions.

Wait until the Download and install process finishes and restart VS.

Use Copilot

Once the two extensions are installed we can start to use VS code.

The first thing you need to check is that you can see the Copilot icon in the VS code. You will see it at the bottom of the main code menu, next to the Zoom controller.

Copilot will provide suggestions in two ways.

Automatic suggestion – While typing code, Copilot will automatically suggest code in the form of functions, variables and more. To accept the suggestion, press the Tab key.

Comments – If you would like to describe Copilot what you are after, type your description in a comment //dosomething

To reject a suggestion, use the Esc key and Alt + . to see alternative suggestions.

Use Copilot Chat

And lastly, you can use the Copilot Chat to ask and chat directly with the Copilot and get answers to code and code related issues. To start using Copilot Chat.

  1. Click on View
  2. GitHub Copilot Chat

Once the chat opens, you can start chatting with the Copilot and ask code-related questions.

To get started with Azure Open AI, visit the following articles:

Success! You're on the list.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.