DEV Community

Cover image for Getting Started with GitHub Copilot Chat in VSCode
Kedasha for GitHub

Posted on

Getting Started with GitHub Copilot Chat in VSCode

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.

copilot-chat-have-access
You have access to GitHub Copilot
copilot-chat-access-signup
You do not have access to GitHub Copilot

Installing GitHub Copilot Chat & asking your first question

Once you verify those details, follow the steps below to start using GitHub Copilot Chat:

  1. 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.

how to install 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.

  1. 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.

Ask copilot chat how to setup ruby project

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.

copilot-chat-slash-command

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.

copilot-explains-code

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.

use copilot chat code suggestions

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.

open chat session in editor

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!

Top comments (12)

Collapse
 
tisleo profile image
Leo

Copilot just keeps getting better πŸ™

Collapse
 
lalami profile image
Salah Eddine Lalami

Hi Leo , welcome πŸ€— to dev community.

Collapse
 
tisleo profile image
Leo

Thanks!

Collapse
 
ladykerr profile image
Kedasha

indeed! Much more to come!

Collapse
 
avwerosuoghene profile image
Avwerosuoghene Darhare-Igben

This post is a quite useful for anyone looking to leverage GitHub Copilot effectively.
Thanks for sharing!

Collapse
 
ladykerr profile image
Kedasha

happy you found it helpful!

Collapse
 
stuartambient profile image
stuartambient

I've been using OpenAi ChatGPT 3.5 for some things but want something more solid and up to date. So I'm at a point to subscribe but should it be Github Copilot or Chat-GPT. Is one better, are they different, do each have their own strengths and weaknesses ?

Collapse
 
utx0_ profile image
utx0_

How longs it take to get approved on the wait list?

Collapse
 
willjohnsonio profile image
Will Johnson

Great introduction Kedasha!

Collapse
 
chideracode profile image
Chidera Humphrey

Helpful article.

Thanks for sharing

Collapse
 
muzammilrawjani profile image
Muhammad Muzammil Rawjani

Thank you for sharing this informative guide on getting started with GitHub Copilot. The integration of AI in the development workflow is an exciting step forward.

Collapse
 
ladykerr profile image
Kedasha

it's definitely super helpful! Especially since it gets context from files