GitHub Copilot is a groundbreaking AI pair programer for developers, but we’re just beginning to explore the future of coding. Over the course of the technical preview, the Copilot team has improved the quality of suggestions and added safety features — but it’s not difficult to see the potential help that Copilot could offer beyond code suggestions.
Today, we’re launching a companion VS Code extension called GitHub Copilot Labs. It is separate from (and dependent on) the GitHub Copilot extension. While Copilot continues to march toward general availability, Labs will be a proving ground for experimental applications of machine learning that improve the developer experience.
Copilot Labs is intended to be experimental in nature, so things might break occasionally. We want to share early features with you to learn what works, what doesn’t, and incorporate your feedback. Labs experiments may or may not graduate into permanent features of GitHub Copilot, but with your help, they can inform future efforts.
Currently, Copilot Labs consists of a VS Code sidebar that houses distinct features. We’re launching with two: “explain this code” and “translate this code”. Once the Copilot Labs extension is installed, you'll see a Copilot icon in the sidebar. Clicking on that will reveal the sidebar, with each experiment in a separate panel.
Every developer learns that writing new code is only a part of software development. Often, the hardest job that developers face is reading and understanding code. Whether it’s because it’s an unfamiliar codebase, or whether the code in question is using a library you might not know, the first step is getting a rough idea of what’s going on, so you can jump in and use the code, or make some changes.
This feature lets you highlight a block of code and ask GitHub Copilot to explain it in plain language:
We provide a few preset prompts to get you started: three that explain what a particular block of code does, and another that generates example code for calling a function.
You can customize the prompt and stop sequence of a query in order to come up with new applications that use Codex to interpret code. Creating these can feel more like an art than a science! Small changes in the formulation of the prompt and stop sequence can produce very different results. The three different “explain” examples showcase strategies that tend to produce useful responses from the model, but this is uncharted territory. We’re excited to see what you use this for.
Language translation works similarly to the explain feature: highlight a chunk of code, select the language you’d like to translate that code into, and hit the “Ask Copilot” button.
While the translations are imperfect, we think they can serve as good starting points for developers who are finding logic in the wild and adapting it to their needs in another language. Again, this is an experimental feature so we’re interested in hearing how you use it and how you might find it useful.
GitHub Copilot is still available as a technical preview, meaning only a small group of testers have access. Everyone in the Copilot technical preview can install and use Copilot Labs. In fact, installing Copilot Labs will require you to install the main Copilot extension if you don’t already have it. If you have not been admitted to the technical preview, then you will be unable to use Copilot Labs.
As always, we’d love your thoughts so we can make Copilot Labs better over time, and find new ways to supercharge your developer experience! Please post your feedback on our discussion forum, and Tweet us @GitHubNext.
Developer Experience Team