|
| 1 | +# GitHub Copilot Cheatsheet - Advanced Features |
| 2 | + |
| 3 | +*Quick reference for advanced Copilot features in VS Code* |
| 4 | + |
| 5 | +## 🎯 Essential Context Variables |
| 6 | + |
| 7 | +| Variable | Purpose | Example Use | |
| 8 | +|----------|---------|-------------| |
| 9 | +| `#codebase` | Project-wide understanding | `How is authentication handled? #codebase` | |
| 10 | +| `#selection` | Current editor selection | `Optimize this function #selection` | |
| 11 | +| `#problems` | Issues from Problems panel | `Fix these errors #problems` | |
| 12 | +| `#changes` | Source control changes | `Generate commit message #changes` | |
| 13 | +| `#terminalLastCommand` | Last terminal command | `Explain this error #terminalLastCommand` | |
| 14 | +| `#testFailure` | Test failure details | `Why is this test failing? #testFailure` | |
| 15 | +| `#usages` | Symbol references/definitions | `Find all uses of this function #usages` | |
| 16 | + |
| 17 | +## 🚀 Powerful Slash Commands |
| 18 | + |
| 19 | +| Command | Purpose | Best For | |
| 20 | +|---------|---------|----------| |
| 21 | +| `/tests` | Generate test suites | Creating comprehensive tests | |
| 22 | +| `/docs` | Generate documentation | Adding docstrings and comments | |
| 23 | +| `/fix` | Fix code issues | Debugging and error resolution | |
| 24 | +| `/explain` | Explain code/concepts | Understanding complex logic | |
| 25 | +| `/new` | Scaffold projects/files | Creating new components | |
| 26 | +| `/setupTests` | Configure testing | Setting up test frameworks | |
| 27 | +| `/fixTestFailure` | Debug failing tests | Test troubleshooting | |
| 28 | + |
| 29 | +## 🎛️ Advanced Features |
| 30 | + |
| 31 | +**Keyboard Shortcuts:** |
| 32 | +- `⌘I` - Inline Chat in editor/terminal |
| 33 | +- `⇧⌥⌘L` - Quick Chat |
| 34 | +- `⌃⌘I` - Open Chat view |
| 35 | +- `F2` - AI-powered symbol renaming |
| 36 | + |
| 37 | +**Chat Participants:** |
| 38 | +- `@workspace` - Project-wide operations |
| 39 | +- `@terminal` - Shell command help |
| 40 | +- `@vscode` - VS Code features help |
| 41 | +- `@github` - GitHub integration |
| 42 | + |
| 43 | +**Custom Instructions:** |
| 44 | +- `.github/copilot-instructions.md` - Project-wide guidance |
| 45 | +- Language-specific settings in VS Code |
| 46 | +- Reusable `.prompt.md` files (experimental) |
| 47 | + |
| 48 | +## 💡 Pro Tips |
| 49 | + |
| 50 | +1. **Combine context**: `#codebase #problems #selection` for comprehensive understanding |
| 51 | +2. **Be specific**: Include framework/library names in requests |
| 52 | +3. **Use drag & drop**: Drop files/folders into chat for instant context |
| 53 | +4. **Chain commands**: Use multiple slash commands in sequence |
| 54 | +5. **Custom instructions**: Create project-specific guidance for consistency |
| 55 | + |
| 56 | +## 🏴☠️ Analytics Project Specifics |
| 57 | + |
| 58 | +**For FastAPI endpoints:** |
| 59 | +``` |
| 60 | +/new FastAPI endpoint for data analysis with Pydantic models #codebase |
| 61 | +``` |
| 62 | + |
| 63 | +**For data processing:** |
| 64 | +``` |
| 65 | +/tests generate tests for pandas data processing functions #selection |
| 66 | +``` |
| 67 | + |
| 68 | +**For debugging:** |
| 69 | +``` |
| 70 | +/fix optimize this query performance #problems #selection |
| 71 | +``` |
| 72 | + |
| 73 | +**For documentation:** |
| 74 | +``` |
| 75 | +/docs add comprehensive docstrings #selection |
| 76 | +``` |
0 commit comments