News

Accepted for GitHub Copilot Chat? How to Get Started and What You Can Do

So you've finally been plucked off the GitHub Copilot chat waitlist. Now what?

The eagerly awaited coding assistant/chat integration -- Copilot meets ChatGPT -- in Visual Studio Code and Visual Studio 2022 opens up all kinds of opportunities for developers looking to increase their productivity and efficiency. By providing suggestions based on the context of the code and the question being asked, GitHub Copilot chat can help developers save time and reduce errors in their code.

[Click on image for larger view.] Welcome @aceramel, I'm your Copilot and I'm here to help you get things done faster. I can identify issues, explain and even improve code. (source: @aceramel).

Here are some tips on installation, setup and usage, summarizing various capabilities that can help developers work smarter and faster. These pertain to the VS Code offering only, not the Visual Studio IDE counterpart.

Getting the Bits
This is cutting-edge preview stuff, so GitHub Copilot Chat requires:

  • An active GitHub subscription: Microsoft says to make sure that the GitHub ID you intend to use has an active subscription to GitHub Copilot and matches the ID that you used to join the GitHub Copilot chat waitlist.
  • The Visual Studio Code - Insiders build:The Insiders program provides early access to new features and updates. Developers can test out new functionality and provide feedback to the dev team before the updates are released to the general public.
    [Click on image for larger view.] VS Code Insiders (source: Microsoft).
  • The GitHub Copilot Nightly Extension: This also provides early access to new features and updates before they are released to the general public. It's updated more frequently than the regular GitHub Copilot extension and may include experimental features that are not yet available in the stable release. The extension has been installed more than 388,000 times.
    [Click on image for larger view.] VS Code Insiders (source: GitHub).

After the Insiders editor is launched, you can install the Nightly extension by opening the Extensions tab in the usual ways (clicking the icon in the activity panel or Cmd+Shift+X on Mac or Ctrl+Shift+X on Windows), searching for and then installing the tool. You may need to sign in to GitHub, and will need to authorize the Insiders build if that hasn't been done.

After that, the chat interface is accessible via a new Chat icon in the activity panel, though a restart of the editor may be required to get it to appear.

Playing with the Bits
So what can you do with the new chat integration?

First, it's always nice to get the day started with the right vibe by greeting your new assistant with a "Good morning!" to which it cheerfully replies "Good morning! How can I assist you with your programming needs today?" while also providing a suggestion on potential questions to continue the conversation.

For a historical background on how chat integration came to be and what it does, Microsoft's introductory March 30 blog post is a good place to start.

While that post lists capabilities and benefits, it also includes this observation: "But perhaps the most important reason for integrating chat is because having a two-way conversation helps you decide what is right and what is wrong. Large language models are not perfect, and they don't 'think'. They simply figure out the next best word to respond with (granted, they are pretty good at this).

"As the Pilot, you are always in charge, and you decide which of Copilot's suggestions to take and what code to bring into your workspace. The ability to ask clarifying questions or provide additional specifics helps you make those key decisions."

As far as capabilities, upon starting up, the tool gives you a synopsis:

I'm here to help you get things done faster. I can identify issues, explain and even improve code.

You can ask generic questions, but what I'm really good at is helping you with your code. For example:
  • Generate unit tests for my code
  • Explain the selected code
  • Propose a fix for the bugs in my code

More specifically, the tool can help with:

  • Interactive Programming: The chat feature allows developers to interact with GitHub Copilot in a more conversational manner. You can ask it to write code, explain code, and even learn from it. This makes the process of coding more interactive and engaging.
  • Code Explanation: One of the standout features of the chat functionality is the ability to ask GitHub Copilot to explain specific parts of your code. This can be a great learning tool, especially for beginners or when working with a new language or framework.
  • Code Generation: You can ask GitHub Copilot to write specific pieces of code for you. For example, you could ask it to write a function that performs a specific task, and it will generate the code for you.
  • Code Review: GitHub Copilot can review your code and provide suggestions for improvements. This can help you catch potential issues before they become problems and improve the overall quality of your code.
  • Learning Tool: The chat feature can be a great learning tool. You can ask GitHub Copilot questions about how to use specific functions or methods, and it can provide explanations and examples.

Some of those things can be done via various slash commands that tailor the conversation to common tasks. Developers can pick from the available commands by typing /:

  • /vscode - Questions about VS Code
  • /tests - Generate unit tests for the selected code.
  • /simplify - Simplify the selected code.
  • /fix - Propose a fix for the problems in the selected code.
  • /explain - Explain step-by-step how the selected code works.
  • /ext - Ask about the VS Code extension development.
  • /help - General help about GitHub Copilot

As far as that first item, asking questions about VS Code, those could include:

  • How do I create a new file in Visual Studio Code?
  • What is the keyboard shortcut for opening the Command Palette in Visual Studio Code?
  • How do I install an extension in Visual Studio Code?
  • What is the difference between a workspace and a folder in Visual Studio Code?
  • How do I debug my code in Visual Studio Code?
  • How do I change the theme in Visual Studio Code?
  • How do I customize my keyboard shortcuts in Visual Studio Code?
  • How do I split my editor window in Visual Studio Code?
  • How do I search for a specific file in my project in Visual Studio Code?
  • How do I use Git with Visual Studio Code?

As far as the last item, /help, it brings up advice like:

"Start by asking questions as if you were talking to a real programmer. This means including implementation details, asking clarifying questions and providing feedback like logs or error messages."

It also provides several tips to have a great conversation:

  • Show me the code you want to talk about by having the files open, maybe even selecting the most important lines.
  • Make refinements by asking me follow-up questions, adding clarifications, providing errors, etc.
  • Review my suggested code and tell me about issues or improvements, so I can iterate on it.

Note that one thing it can't do is insert HTML list item tags, <li> and </li> around a list of sentences, something this article makes great use of. I tried repeatedly to get chat to do this, but while it happily agreed to do so and seemingly offered up the result, the result was just blank space -- nothing.

I finally asked ChatGPT (Plus version, with GPT-4 AND WebPilot plugin) how to write the prompt, and even that prompt didn't work. ChatGPT, however, superbly accomplished the task with its own suggested prompt. This indicates that the chat integration isn't really "Copilot meets ChatGPT" as mentioned above because ChatGPT can do things GitHub Copilot chat can't.

There are probably things Copilot chat can do that ChatGPT can't do, though, as it's optimized for coding (just not HTML list item tags), but the only way to find out is to get your hands on the tool and play around with it.

That, of course, depends upon being accepted from the waitlist. If you still aren't on the waitlist, it can be accessed here.

While this article is VS Code-specific, much of it also pertains to GitHub Copilot chat integration into the Visual Studio IDE. For more on that, a good place to start is the March 22 blog post from Microsoft titled, "GitHub Copilot chat for Visual Studio 2022."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

Subscribe on YouTube