Ensure you have the GitHub Copilot extension installed and enabled in your IDE to use inline chat.
Opening Inline Chat
Use one of the following methods to launch the inline chat panel:| Platform | Shortcut | Alternative |
|---|---|---|
| macOS | ⌘ + I | Right-click in editor → Copilot Editor Inline Chat |
| Windows/Linux | Ctrl + I | Right-click in editor → Copilot Editor Inline Chat |
Explaining Code Inline
Highlight any function or block, typeexplain (or /explain), and Copilot injects an inline comment detailing its behavior. For example:
Refactoring Hard-Coded Values
Use inline chat to replace literals with external configuration.Original:
Consolidating Configuration Constants
At the top of your file, organize all constants for clarity and easy maintenance:Generating New Code with Inline Chat
Prompt Copilot to scaffold helper functions. For instance, generateget_light_state logic:
Creating Unit Tests with Pytest
Copilot can also generate test scaffolding. For example:Always install and pin your test dependencies to avoid mismatched versions: