Omar Hosney
GitHub Copilot in VS Code Cheat Sheet
Chat with Copilot
- ⌃⌘I - Open the Chat view to chat with Copilot using natural language.
- ⇧⌘I - Start a code editing session across files.
- ⇧⌥⌘L - Open Quick Chat for quick questions.
- ⌘I - Start Inline Chat directly from the editor.
- Type @ to address participants or get domain expertise.
Code Editing Session
- ⇧⌘I - Open Copilot Edits and apply code changes.
- Accept or Discard edits in a multi-file editor.
- Attach relevant files to the working set.
Generate Code
- Ask Copilot to generate or optimize algorithms.
- Insert code into the active editor or a new file.
- Attach framework details for better suggestions.
Attach Context
- ⌘/ - Add context like files or symbols.
- Use variables like #editor or #selection to refine prompts.
Code Completions
- Start typing to get AI-powered suggestions.
- Provide meaningful comments to improve code quality.
- Use F2 for AI-driven renaming.
Debug and Fix
- /fix - Resolve issues like compiler errors.
- /fixTestFailure - Troubleshoot failing tests.
- /startDebugging - Configure debugging sessions.
Generate Tests
- /tests - Create tests for uncovered code.
- /setupTests - Get guidance on test frameworks.
Source Control
- Generate commit messages and pull request descriptions.
- Ask @github about issues or PRs.
Scaffold Projects
- /new - Scaffold a project or file.
- /newNotebook - Generate Jupyter notebooks with requirements.