GitHub Copilot
GitHub Copilot provides AI-powered code suggestions directly in your editor.
Setup
VS Code
- Install the GitHub Copilot extension from the VS Code marketplace
- Sign in with your GitHub account
- Copilot will begin suggesting completions as you type
JetBrains
- Go to Settings > Plugins > Marketplace
- Search for and install GitHub Copilot
- Restart your IDE and sign in
Usage patterns
Inline completions
Start typing and Copilot will suggest completions in gray text. Press Tab to accept, or Esc to dismiss.
Copilot Chat
Open the chat panel to ask questions about your code:
- Explain a function or block of code
- Generate unit tests
- Suggest refactoring approaches
- Debug error messages
Slash commands in chat
/explain— Explain the selected code/tests— Generate tests for the selected code/fix— Suggest a fix for problems in the selected code/doc— Generate documentation
Effective prompting
- Write clear comments before code to guide suggestions
- Provide function signatures and let Copilot fill in the implementation
- Use descriptive variable and function names — Copilot uses them as context