Introducing GitHub Copilot
In 2021, GitHub announced a new artificial intelligence tool called GitHub Copilot. GitHub Copilot is an editor extension that integrates into different editors including JetBrains Rider, VS Code, and all editions of Visual Studio 2022.
What GitHub Copilot does is it looks at the code you just typed and generates predictions for the code it thinks you’re about to type. If it has a prediction and you are not currently typing, GitHub Copilot displays the prediction in grey text in front of your cursor for you to evaluate and possibly add to your code, as shown in Figure 11.1:
Figure 11.1 – GitHub Copilot suggesting code to add as the developer types
Copilot does this by using a predictive machine learning model that has been trained on various pieces of code in many different programming languages, including C#, F#, JavaScript, and SQL.
Understanding GitHub’s predictive model
If this sounds familiar...