Starting with Copilot

As my main job involves iOS development using Xcode, there hasn’t been a straightforward way to integrate Copilot with it, so I had not used Copilot until now.

However, I am currently working on a few projects that require Python and Ruby, and I have started experimenting with GitHub’s Copilot, hoping it will accelerate my development in these unfamiliar domains.

About the Copilot Service

GitHub Copilot is an AI-powered coding tool that provides contextually relevant suggestions as you code. Powered by OpenAI’s Codex AI system, which is trained on public internet texts and billions of lines of code, GitHub Copilot can save development time, enhance code quality, and facilitate learning new languages or frameworks.

To use GitHub Copilot, you first need to apply for a trial and then install the GitHub Copilot extension in Visual Studio Code. GitHub Copilot can be used with any language or framework but is particularly effective with mainstream languages such as Python, JavaScript, TypeScript, Ruby, Java, and Go. It suggests entire lines or functions in grey text based on your code content and comments. You can accept suggestions by pressing Tab or dismiss them with Alt + \. You can also press Ctrl + Enter to open the GitHub Copilot suggestion window for more options.

While GitHub Copilot is a powerful tool, it is not infallible. It may produce incorrect, insecure, or copyright-infringing code. You should always review the suggestions from GitHub Copilot and take responsibility for the code you write. Furthermore, GitHub Copilot will not make architectural or business logic decisions for you; you still need to understand the technical structure and break down problems into manageable steps.

Key features of GitHub Copilot include:

  • It generates code snippets that are logical and syntactically correct based on developers’ comments, function names, variable names, and other cues.
  • It learns from open source code repositories about various programming languages and frameworks, adapting to the developer’s style and preferences.
  • It provides multiple code suggestions, allowing developers to choose the most suitable one or modify and combine them to create desired code.
  • It can be used in any editor or environment, simply by installing the GitHub Copilot extension and linking it with a GitHub account.
  • It is a continuously learning and improving tool, becoming smarter and more accurate with use and feedback from developers.
  • When you see a suggestion in grey text, press Tab to accept it or Esc to ignore it.
  • If you do not see a suggestion or want to change it, you can use the following shortcuts:
    • Alt + \: Dismiss suggestion
    • Alt + [, Alt + ]: Switch between different suggestions
    • Ctrl + Enter: Open the suggestion window

Getting Started with Copilot

Copilot Quickstart

On this page, enter your payment information to start using Copilot. If you are using VSCode, the Copilot plugin will link to your GitHub account, and you can begin leveraging Copilot to assist with your projects.

Updated: