
Guide
How to use GitHub Copilot in VS Code
Once GitHub Copilot is running in VS Code, the gains come from building it into everyday tasks: tests, refactors, debugging and reviews. Here are practical workflows and the features that support them.
Writing tests
Select a function and ask Copilot Chat to write tests covering normal cases, edge cases and errors. Run them, and ask Copilot to fix failures or explain them. Tests written this way are a fast safety net before refactoring.
Refactoring
Describe the change, such as split this file into smaller modules or replace callbacks with async functions, and review Copilot's proposed edits across files before accepting. Run tests after each step.
Debugging
Paste an error or select failing code and ask for the likely cause. In agent mode, Copilot can run the tests, read the output and try fixes, stopping for your approval.
Next edit suggestions
Copilot can predict the next edit you are likely to make elsewhere in the file, such as updating related code after a rename, and offer it with Tab.
Reusable prompts and instructions
Repository instructions describe your conventions so every answer follows them. Prompt files store reusable task prompts, such as how your team writes a new endpoint, that anyone can run.
Tools through MCP
Agent mode can use tools from MCP servers, such as a database, an issue tracker or documentation, so Copilot can look things up while working. Only add servers you trust, with limited permissions.
Reviewing changes
Ask Copilot to review your changes before committing, looking for bugs, missing tests and unclear names. Treat its comments as a first pass.
Where to start
Pick one module with few tests, have Copilot write tests for it, then use those tests to support a refactor.
Where we do this for you
Want this done for you?
We set this up, build it and train teams on it.
Tool page
GitHub Copilot for business
Policies, repository rules, and developers trained on real work.
Read moreTraining
Copilot training
Hands-on Copilot training for teams that work in Microsoft 365.
Read moreTool page
Copilot for business
Copilot in Outlook, Word, Excel and Teams, with your files in order.
Read moreService
AI strategy
Where AI fits in your business, what to do first, and how the business gets more efficient over the next 2 years as AI scales up.
Read moreQuestions
How to use GitHub Copilot in VS Code: your questions answered
Still have a question?
Talk to usCan GitHub Copilot write tests in VS Code?
Yes. Select code and ask in chat, then run and review the tests.
What are next edit suggestions?
Copilot predicting your next likely edit and offering it.
What are prompt files?
Saved, reusable task prompts that anyone on the team can run.
Can Copilot use outside tools in VS Code?
Yes, through MCP servers in agent mode.
Can Copilot review my code?
It can review changes and suggest improvements before you commit.
How do I make Copilot follow our conventions?
Add repository instructions describing them.
Keep reading
More guides and pages

Want your team using this properly?
Our training days are hands on, at your office or remote.

