Copilot Chat
Copilot Chat is the conversational AI panel inside your IDE — a coding assistant you can talk to about your code without leaving the editor. Unlike completions (which are passive and triggered by typing), Chat is active: you ask questions, give instructions, and get back explanations, fixes, generated code, or documentation. It has full access to your open files and selected code.
What You Can Do
Explain code
Select a block of code and ask 'what does this do?' — Copilot explains in plain language, including edge cases and side effects.
Fix bugs
Paste an error message or select broken code and ask to fix it. Copilot analyzes the error, explains the cause, and proposes a fix.
Generate tests
Ask to write unit tests for a selected function. Copilot generates tests using your existing test framework (Jest, pytest, JUnit, etc.).
Write documentation
Ask to document a class, function, or module — generates JSDoc, docstrings, or README sections based on the code.
Refactor code
Ask to improve readability, reduce complexity, extract a function, or apply a design pattern to selected code.
Ask about the codebase
On Enterprise plans, Copilot can answer questions about your entire repo ('where is the auth logic?', 'what does this service depend on?').
Slash Commands
Type / in the chat input to trigger built-in commands:
| Command | What It Does |
|---|---|
| /explain | Explain selected code or the active file |
| /fix | Fix a bug or error in the selected code |
| /tests | Generate unit tests for the selected function or file |
| /doc | Generate documentation comments for selected code |
| /new | Scaffold a new file, project, or component |
Context References (@)
Use @ to explicitly add context to your chat messages:
@workspace— include the full workspace context (Enterprise: entire repo index)@vscode— ask about VS Code features, settings, and commands#file:filename.ts— reference a specific file by name#selection— reference the currently selected code
Inline Chat
Press Ctrl+I (or Cmd+I on Mac) anywhere in the editor to open an inline chat panel directly at your cursor position. This lets you request a change without navigating to the side panel — ask for a change, see the diff inline, and accept or discard it without leaving your code.
Chat vs Completions
| Aspect | Completions | Chat |
|---|---|---|
| How triggered | Passive — as you type | Active — you ask a question |
| Output format | Ghost text in editor | Conversation + code blocks |
| Best for | Fast code entry, boilerplate, patterns | Explanation, debugging, generation, refactoring |
| Context | Auto-selected from open files | You control via @-references |
Checklist: Do You Understand This?
- Chat is an active conversation panel — you ask, Copilot responds with explanations and code
- Slash commands: /explain, /fix, /tests, /doc, /new — shortcuts for common tasks
- @ references: @workspace, @vscode, #file:name — add explicit context to chat messages
- Inline chat (Ctrl+I): make edits at cursor, see diff inline, accept or discard
- Enterprise plan unlocks full repo indexing — Copilot can answer questions about the entire codebase