Get "PHP 8 in a Nuthshell" (Soon includes PHP 8.4)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

I got access to GitHub Copilot Chat

I recently got access to the GitHub Copilot Chat private beta and I was really excited to try it out. I’ve been using it for a couple of days now and I’m impressed with the results.

Essentially, GitHub Copilot Chat is like good old GitHub Copilot but on steroids. It does all the things that GitHub Copilot does but in a more familiar chat-like interface like ChatGPT for example.

Installation

To get started with it, you would obviously need to be enrolled in the private beta program and once, you’re into it, you’ll need to download the Code Insider version of VS Code which is a beta version of VS Code where you can use GitHub Copilot Chat.

Once you’ve installed the Code Insider version of VS Code, you’ll need to install the GitHub Copilot Chat nightly extension from the marketplace. Once you’ve done that, a new Chat icon appears in the activity panel. Click on it to see the conversation interface. But before that, you would need to sign in to your GitHub account.

Here’s what the interface looks like.

GitHub Copilot Chat

As you can tell, it’s a chat-like interface where you can type in your queries and GitHub Copilot will respond to it with the code suggestions, improvements, code refactoring, error resolutions, and so on. You can even ask it to write tests for the code you’ve written. It’s simply cool!

Explains code

So, for instance, if you have got a function and you have difficulty understanding what it does, you can select that piece of code and ask in the chat to explain it like so.

GitHub Copilot Chat explains code

As you can tell, it will explain the code to you in a very human-like way.

Improves code

You can ask it to improve your code like so.

GitHub Copilot Chat improves code

As you can tell, it gives you suggestions on how you can improve your code and present you with a piece of code that you can replace with your existing code.

Help write tests

You can ask it to write tests for your code like so.

GitHub Copilot Chat writes tests

Fixes bugs

It effortlessly finds bugs in your code and suggests you the fixes. So, I deliberately changed the name of a function that doesn’t exist and asked it to fix it. And it did find the typo and suggested me the fix.

GitHub Copilot Chat fixes bugs

Invoke inline suggestions

But the best part about GitHub Copilot Chat is that you can invoke it inline. So, for instance, if you have a function that you want to improve, you can select that function and invoke GitHub Copilot Chat inline by pressing Cmd / Ctrl + i and a little text box will appear where you can type in your query and it will give you suggestions inline that you can choose to accept or dismiss by pressing Esc .

GitHub Copilot Chat inline suggestions

As you can tell, using it inline lets you do everything that you can do in the chat interface but without losing the context of the code you’re working on.

In closing

These are a few of the common examples in which you can use Copilot Chat but the possibilities are endless and it all comes down to the fact that how you would construct your prompts to get the most out of it.

But as far as the improvements to this extension are concerned, it definitely surpasses its predecessor GitHub Copilot by a huge margin. On top of being a “copilot”, it’s also a “companion” that you can talk to and get things done!

Like this article?

Buy me a coffee

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?