Getting Started with GitHub Copilot Chat in VSCode
Kedasha
Posted on August 21, 2023
GitHub Copilot Chat is an extension that works in your Code Editor or IDE (VS Code or Visual Studio currently) that allows you to have conversations with GitHub Copilot right from your editor.You're able to get code suggestions, build, debug and tests applications with an AI model that understands natural language right from your editor.
Getting started
To get started using GitHub Copilot Chat in VSCode, ensure that you have access to the extension by checking your email for access privileges. You get access privileges through your organization or by being taken off the waitlist for the private beta for individuals. You also need to ensure that you have an active GitHub Copilot subscription.
To verify your access, click on your GitHub profile and select "Try Copilot." If you have access to GitHub Copilot, you will see a message at the top of your settings page indicating such and if you don't have access, you will be routed to another page to start your 30-day free trial.
Installing GitHub Copilot Chat & asking your first question
Once you verify those details, follow the steps below to start using GitHub Copilot Chat:
- Search for "GitHub Copilot Chat" in the vscode extension marketplace, and click the blue install button. After the installation, you'll be prompted to login to your GitHub Account to validate your access to copilot chat.
Be sure to sign in to the GitHub account that has access to your GitHub Copilot subscription and also that has access to Copilot Chat.
- Once you've installed the extension, you're ready to use it! You'll see a message/chat icon appear on the side of your code editor, click that icon and start asking programming related questions.
You can start by asking a simple question like "How do I set up a new ruby project?" and it will provide you with a suggestion.
And that's how you start using copilot chat in VSCode.
Slash Commands + GitHub Copilot Chat
There are some really amazing slash commands that you have access to as well that makes it easier to ask for help, create vscode extensions or create unit tests. To start using Slash Commands with GitHub Copilot, type /
in the input box and you'll see the multiple options come up.
Choose one of the options and then ask a question to get a suggestion.
Asking GitHub Copilot Chat questions about your code
To ask Copilot Chat specific questions about the code you're working on, open up the file in your editor, and navigate to the chat extension.
Let's say for example this is your first time interacting with this particular repository, and you don't quite understand the code, you can ask copilot chat "what does this file mean?" and it will provide a suggested explanation of what the code is doing.
Using Code Suggestions from GitHub Copilot Chat
Whenever you ask copilot chat for code suggestions, you can accept them by copying the suggestion from the chat interface or clicking the "Insert at Cursor" button. You can also insert the suggestion into a new file, or run the code in the terminal if applicable.
I was able to use GitHub Copilot Chat to tell me how to insert two images side by side using markdown βΊοΈ I copied to provided code suggestion and pasted it here and voila! I had two images side-by-side. ππ½
Opening a Copilot Chat session in your editor
To make your life a little easier, we've made it possible to open up a copilot chat session right in your editor, so you don't have to go back and forth between the chat interface and your files.
To do this, click on the chat icon on the side, and click the three dots at the top and select "Open session in editor" this will move the chat into your editor, similar to how a file would be open.
If you have any issues, questions, comments or concerns, feel free to leave them below and I'll try as best as possible to get you an answer! I hope you enjoy using GitHub copilot Chat as much as I do!
Happy Coding!
Posted on August 21, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.