What is the GitHub Copilot extension for Visual Studio?

Applies to: yesVisual Studio noVisual Studio for Mac noVisual Studio Code

GitHub Copilot and GitHub Copilot Chat extensions in Visual Studio enable enhanced AI-assisted development in Visual Studio, helping you be more productive and efficient when writing code.

In this article, you learn about the Copilot extension, an AI-powered pair programmer extension for Visual Studio that provides you with context-aware code completions, suggestions, and even entire code snippets. This powerful tool aids AI-assisted development in Visual Studio and helps developers write code more efficiently, reduce the time spent on repetitive tasks, and minimize errors.

For more information on the GitHub Copilot Chat extension in Visual Studio, see About the GitHub Copilot Chat extension for Visual Studio.

How GitHub Copilot works

GitHub Copilot works by utilizing advanced machine learning models trained on a vast dataset of publicly available code from GitHub repositories. As you type code, the AI analyzes the context and provides relevant suggestions in real-time. You can receive suggestions also by writing a natural language comment describing what you want the code to do.

Animated screenshot that shows the code completion capabilities of the GitHub Copilot extension.

You can also use GitHub Copilot to convert comments to code, create unit tests, create SQL queries, and more.

Prerequisites

To get started, you need:

GitHub Copilot supports several programming languages and frameworks, including but not limited to: C#, C++, and Python.

Installation instructions

You can install GitHub Copilot as an extension, but we recommend you install GitHub Copilot as a component using the Visual Studio Installer.

Install using the Visual Studio Installer

  1. Launch the Visual Studio Installer.

  2. Select the installation of Visual Studio you want to modify, and then select Modify.

  3. Select any workload, for example, .NET desktop development.

  4. Select GitHub Copilot from the list of Optional components, and then select Modify to install the extension.

    Screenshot that shows using the Visual Studio Installer to install the GitHub Copilot component.

    Note

    You'll use the Manage Extensions dialog to manage updates to the GitHub Copilot extension.

Install using the Manage Extensions dialog

  1. Open Visual Studio.
  2. On the menu bar, select Extensions > Manage Extensions.
  3. In the Search box, enter "GitHub Copilot".
  4. Select the GitHub Copilot extension, and then select the Download button.
  5. Restart Visual Studio to complete the installation process.

Note

For more information about activation & authorization, see the Installing the Visual Studio extension section in GitHub Docs.

After installation, you can start using GitHub Copilot by typing code in the editor and observing the suggestions provided by AI.

Exploring GitHub Copilot

To see GitHub Copilot in action, check out the following video tutorial.

Video length: 1.19 minutes

Next steps

To learn more about the current GitHub Copilot extension for Visual Studio, consider exploring the following resources: