Leverage GitHub Copilot in Visual Studio Code and ASP.NET Core
AI is everywhere. Almost all the leading software development platforms and tools use AI in some of the other way. As an ASP.NET Core developer wanting to use Visual Studio Code for your development, you must know how to leverage the power of GitHub Copilot from within the VS Code editor. In this series of articles I am going to explain a few features of GitHub Copilot that can help you increase your productivity, efficiency and code quality.
Simply put, GitHub Copilot is an AI driven pair programmer or coding assistant. It is developed by GitHub and OpenAI. GitHub Copilot can assist you writing and editing your code from within your favorite programming IDE including VS Code, Visual Studio, Azure Data Studio, and more. Although GitHub Copilot comes with a plethora of useful features at the core it offers three main services -- AI powered code completion and code suggestions, a powerful integrated chat experience, and code editing across multiple files.
If you visit GitHub Copilot website, as on this writing, it offers four plans : Free, Pro, Business, and Enterprise. You need a GitHub account to avail these plans. The feature comparison between several GitHub Copilot plans is also available here. If you see the Free plan mentioned on the above page it says this :
With free subscription, you can avail upto 2000 code completions and 50 chat requests per month. I am going to go ahead and use the Free plan for my examples. To subscribe, you need a GitHub account. I am going to use an account I already have but if you don't have GitHub account you will need to create it before subscribing to GitHub Copilot.
Once you have GitHub account ready, sign-in using that account as you normally do.
Upon signing in, open the main menu and locate Your Copilot option as shown below.
In the Your Copilot page you will see that you are already set to use Copilot for free.
Under the Features section of this page you might want to Enable / Disable a few settings and that is all you need to do in your GitHub account for now.
Next, open Visual Studio Code and click on the GitHub Copilot icon from the top.
This will open Copilot panel as shown below.
When you click the Sign-in button, VS Code will launch the default browser and take you to GitHub sign-in page.
You will be asked to authorize VS Code to access your GitHub account.
Clicking on the Authorize button will show this browser dialog :
Click on the Open button to complete the sign-in flow and return to the VS Code editor.
The Copilot will now show the Chat window ready for your chat requests :
While completing this sign-in flow, VS Code also installed the following Copilot extensions for you :
Now that you have Copilot setup in your VS Code editor, you can start exploring its features. We will do that in the next part of this series.
That's it for now! Keep coding!!