GitHub Copilot

GitHub Copilot

GitHub Copilot

GitHub Copilot is a highly popular AI product for developers, available as an extension in various IDEs. Its features include the Copilot AI pair programmer, Copilot Chat, Copilot CLI, and Copilot for pull requests.

Impact

image

Model(Feb 6th)

The LLM utilized by GitHub Copilot is not clearly stated in the available search results. The most recent details are from a GitHub blog post on December 6, 2023, which outlines the ongoing development of GitHub Copilot and the use of LLMs to boost its functions. Given GitHub's close ties with Microsoft and OpenAI, it's plausible that GitHub Copilot employs a combination of ChatGPT-3.5 and ChatGPT-4, a hypothesis partially confirmed by the Copilot team.

image

Features

Here are the most useful features that will enhance your experience with the tool.

Add files explicitly to the context

image

Get more suggestions

Instead of waiting for the ghost text to appear, press `CTRL` + `ENTER` on your keyboard (⌘ + `ENTER` on Mac).

Official documentation: Seeing alternative suggestions, Seeing multiple suggestions in a new tab

image

Context

We recommend to read the original article How GitHub Copilot is getting better at understanding your code

image

On the left side of the diagram, there are three sources that Copilot uses to build context:

  • The code before and after the cursor
  • Open tabs
  • The vector database constructed over the project

IDE support

GitHub Copilot is compatible with most popular IDEs, although its functionality may vary. For example, Copilot does not automatically add files to the context of the chat in VS Code-like IDEs. In IntelliJ IDE, the chat feature is only available after the beta period ends.

VS Code(v1.86.0)

Context in Copilot chat(v0.12.0) in VS Code(v1.86.0) works differently that in JetBrains IDEs. It does not automatically establish the context, even for the open file being worked on directly.

Previously, this information was automatically included when you hadn't selected text in the editor. Now, you can choose to explicitly add the visible code to the context or omit it for more general questions.

VSCode official documentation

You have to explicitly specify context using commands

@workspace - for workspace context lookup

@terminal - to reference terminal logs

@vscode - to know more about VS Code features and APIs

#selection - to focus Copilot's suggestions on the specific text you select in the editor.

#file - to reference specific files

#editor - the visible code of the active editor

PROS

  • The Enterprise plan, which is expected to be available in February 2024, supports fine-tuning on the organizational code base.
  • Provides variety of products(CLI, PRs)

CONS

  • Does not provide any settings and control over the prompting
  • Explicitly added files still can be ignored
  • Inconsistent experience in different IDEs