All patterns

GitHub Copilot by GitHub/Coding

Copilot guesses your next edit

Change something in your code and Copilot suggests the follow-up change, even further down the file. It shows the edit as a red and green diff and marks the line with an arrow. Tab takes you there, Tab again accepts it.

An inline diff proposes the logic fix. The arrow in the gutter marks the suggested line.
An inline diff proposes the logic fix. The arrow in the gutter marks the suggested line.

About GitHub Copilot. GitHub Copilot is an AI coding assistant inside editors like VS Code, Visual Studio, Xcode and JetBrains IDEs.

01

What to notice

  1. 1

    It can change code, not just add it

    The suggestion can delete and rewrite lines. You see it as a red and green diff instead of gray ghost text.

  2. 2

    An arrow shows where the edit is

    A small arrow in the margin points to the line, even when it's far away from your cursor.

  3. 3

    Tab twice: go there, then accept

    The first Tab moves you to the change, the second applies it. You always see it before it happens.

  4. 4

    Escape makes it go away

    Saying no costs one key, so a bad suggestion never breaks your flow.

02

Why it works

01

Most coding is changing existing code

Rename a variable and you have to update every place it's used. Copilot handles that boring part.

02

You see the change before it lands

Because the diff shows exactly what will change, people accept more suggestions.

03

Nothing new to learn

Tab and Escape already mean yes and no to developers. The feature uses habits they have.

03

Use it in your product

Do this

  • Use what the user just did to guess what they'll do next.
  • Show suggested changes as a before and after, and never apply them silently.
  • Point to suggestions outside the visible area with a small, consistent marker.
  • Use the keys people already use for yes and no.
  • When the change is far from where the user is working, separate "go there" from "accept".

Watch out

  • Suggestions that pop up while the user is typing somewhere else feel jumpy. Show them when the user pauses.
  • A small arrow in the margin is easy to miss. Add a hint the first few times.
TagsCodeInline diffKeyboardPredictionScreens: GitHub / Microsoft

Join the aidesign.gallery list

For new patterns, guides and the book we are writing. It is free.

Unsubscribe anytime. Privacy policy

Related patterns