Copilot Chat & Inline Ask
Copilot Chat lets you have a conversation with AI about your code — explain it, refactor it, generate tests, or ask architecture questions, all inside VS Code.
1Opening Copilot Chat
Click the Chat icon (✦) in the Activity Bar, or press Ctrl+Alt+I. The chat sidebar opens where you can ask anything about your code. Chat has access to your open files, workspace, and the currently selected code.
2Inline Chat
Press Ctrl+I while in the editor to open Inline Chat — a floating input that applies changes directly to your code. Type a natural language instruction and press Enter. Copilot will show a diff you can accept or reject.
"Add error handling to this function" "Convert to async/await" "Add JSDoc comments" "Simplify this logic"
3Using /commands in Chat
Copilot Chat has built-in slash commands:
/explain— explain the selected code/fix— fix the selected error/tests— generate unit tests/doc— add documentation comments/simplify— simplify the code/new— scaffold a new file or project
4Chat Participants & Context
Use @workspace to ask questions about your entire project, @vscode to ask about editor features, or #file / #selection to attach specific context. Example: "@workspace explain how authentication works in this codebase".
5Generating Tests with Copilot
Select a function, open Inline Chat, and type /tests. Copilot will generate a complete test suite in your project's testing framework (Jest, Vitest, Pytest, etc.).