After this lesson, you will be able to: Use GitHub Copilot for inline suggestions and Copilot Chat to ask questions about your codebase without leaving VS Code.
Copilot is the AI tool most professional developers use day to day. It autocompletes as you type, generates whole functions from a comment, and answers questions about your codebase in a chat panel. This lesson covers how to install it, use it effectively, and know when to ignore its suggestions.
Free for students; free trial otherwise.
Install VS Code (code.visualstudio.com) if you don't have it
Sign up for GitHub Copilot, free for students with the GitHub Student Pack
In VS Code, install the extensions "GitHub Copilot" and "GitHub Copilot Chat"
Sign in to GitHub from the Accounts icon in VS Code
Open any code file. Copilot starts suggesting completions in gray text
Inline: as you type, Copilot suggests the next few lines in gray. Press Tab to accept, Esc to dismiss. Chat: open the Copilot Chat panel (sidebar) and ask questions in plain English. Use @workspace to refer to your project, /explain to explain selected code, /tests to generate tests for it.
Type a comment describing what you want, then let Copilot generate the function.
// Validate that the email is a valid format and that the domain is allowed.// Allowed domains: ['gmail.com', 'school.edu']// Return { valid: true } or { valid: false, reason: string }function validateEmail(email) {// Copilot fills this in for you, read it carefully before accepting}
Copilot sometimes invents APIs that don't exist ("hallucination"). It also picks up subtle bugs from training data, e.g., off-by-one errors or missing null checks. When the suggestion looks too convenient ("oh wow it just knows the right library!"), pause and verify. Always test, always review.
When would you use one versus the other?
Sign in and purchase access to unlock this lesson.