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.
- Click on File
- Click on Account Settings
- 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.
- Click on Extensions
- 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.
- Click on View
- 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:
- Get Started With Azure Open AI .NET SDK
- Use Azure OpenAI with C# Application
- Deploy Azure OpenAI Resource With Terraform
- Connect to Azure OpenAI Using Postman
- Azure AI vs Azure Open AI
- Azure AI Studio vs Microsoft Copilot Studio
- Get Started With Azure AI Studio
- Create Prompt Flow for an LLM App in Azure AI Studio
- Detect Language using Azure AI Services
- Use GitHub Copilot to Write and Manage Code