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'll 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.

Exploring GitHub Copilot

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

Video length: 1.19 minutes

Prerequisites & supported programming languages

To get started, you need:

  • Visual Studio 2022 version 17.4.4 or later

  • a GitHub Copilot subscription.

    Tip

    GitHub Copilot is free for verified students and for maintainers of popular open source projects on GitHub.

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

Installation instructions

  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.

Next steps

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