Menu Close

Implement GitHub Copilot Chat in Visual Studio

Implement GitHub Copilot Chat in Visual Studio

In this article we will learn about Implement GitHub Copilot Chat in Visual Studio. Here we will explore what GitHub Copilot is, why it is utilized, what benefits developers may gain from it, and ultimately how to enable this. Please read my previous article of GitHub Copilot Chat in VS Code for Developers.

What is GitHub Copilot?

Github copilot chat is an artificial intelligence (AI) application that assists developers in answering questions and generating code in a simple and engaging manner. It is a Chat GPT for developers, to summarize.

It is important to emphasize that this tool is in preview mode. Those who have access to the beta and have a Github copilot account can use it in test mode at the moment.

Prerequisite

  • Ensure you’re running Visual Studio 2022 17.5.1 or higher. If not, please update.
  • Download and install the Visual Studio extension for GitHub Copilot – Preview
  • Ensure you are logged in to Visual Studio using the same GitHub ID that you used to sign up for the waitlist. If you are not signed with an authorized account you’ll be prompted to do so. If you are already logged in with your GitHub ID in your Visual Studio, please check you don’t need to re-enter your GitHub credentials. Here is the link with instructions to Add your GitHub ID to your Visual Studio signin.
  • Start Visual Studio. Once fully loaded, check that the GitHub Copilot Chat window shows on your View menu. Then verify that “Ask Copilot” appears at the top of the right click menu in your code editor when a code file is open.

Configuring GitHub Copilot chat in Visual Studio

Step-1 : GitHub Copilot account

  • To configure GitHub Copilot let’s, open the GitHub copilot link and login with GitHub account and then click on Free Trial.
GitHub Copilot Chat-Free Trial
  • On the following screen, we can see two alternatives, monthly plan and yearly plan, and we may click on the highlighted button. Note: The first month is free, then you may be charged money according to the plan, so you can withdraw the payment details before the charge money.
GitHub Copilot Chat-30 day Free Trial
  • On below screen, we need to add the communication address and select the payment method and save payment method information.
GitHub Copilot Chat-Payment Method
  • Once the payment method is done then we can see below screenshot of the GitHub copilot is ready.
GitHub Copilot Chat Ready

Setting Up GitHub Copilot Chat in Visual Studio

To setup GitHub Copilot in Visual Studio follow below steps.

  • Open Visual Studio go to Extensions -> Manage Extension
Implement GitHub Copilot Chat in Visual Studio-Manage Extensions
  • Install Visual Studio extension for GitHub Copilot Preview like below screen.
Implement GitHub Copilot Chat in Visual Studio-Install Visual Studio Extension Preview
  • Install the GitHub Copilot preview.
Implement GitHub Copilot Chat in Visual Studio-Install VS Extension Preview

  • After installing the extension restart the visual studio and then Go to View -> Select GitHub Copilot Chat

Test GitHub Copilot Chat in Visual Studio

  • Here on the below example we create command to optimize the code and you can see on below it suggest the optimization my code.
GitHub Copilot Chat-Optimize Code
  • On below we add the command to create the X-Unit for my controller.
GitHub Copilot Chat- Unit Test
  • Here on the below we ask the command to create employee model with Data annotation required field.

Conclusion

In this article we discussed about Implement GitHub Copilot Chat in Visual Studio. Github copilot chat is an artificial intelligence (AI) application that assists developers in answering questions and generating code in a simple and engaging manner. Github copilot chat is a Chat GPT for developers, to summarize.

Leave behind your valuable queries, suggestions in the comment section below. Also, if you think this article help to you, do not forget to share this within your developer community. Happy Coding 🙂



Latest Articles



SUPPORT ME

Leave a Reply

Your email address will not be published.