mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 13:31:07 +01:00
* Scaffold plan & learn modes, project instructions * Add the .vscode folder as a source for instructions
2.1 KiB
2.1 KiB
applyTo
| applyTo |
|---|
| ** |
VS Code Copilot Development Guide
This file contains key information to help AI assistants work more efficiently with the VS Code codebase.
Quick Reference for Common Issues
Build & Test Workflow
- Compile:
npm run compile(required before testing code changes) - Run specific tests:
./scripts/test.sh --grep "pattern" - Test file location:
out/directory contains compiled JavaScript - Extension compilation: Extensions compile separately and take significant time
Code Architecture Patterns
Testing Strategy
- Unit tests in
src/vs/*/test/directories - Integration tests in
test/directory - Use
npm run compilebefore running node-based tests
Common Gotchas
Module Loading
- Use compiled files from
out/directory when testing with node - Import paths:
const { Class } = require('../out/vs/path/to/module.js') - ES modules require
.mjsextension or package.json type modification
Test Location
- Don't add tests to the wrong test suite (e.g., adding to end of file instead of inside relevant suite)
- Look for existing test patterns before creating new structures
- Use
describeandtestconsistently with existing patterns
Investigation Shortcuts
Finding Related Code
- Semantic search first: Use file search for general concepts
- Grep for exact strings: Use grep for error messages or specific function names
- Follow imports: Check what files import the problematic module
- Check test files: Often reveal usage patterns and expected behavior
Build Optimization
- Compilation takes ~2 minutes - do this once at start
- Extensions compile separately - skip if not needed
- Use incremental compilation for faster iteration
File Structure Quick Reference
src/vs/
├── base/common/ # Core utilities (color.ts, etc.)
├── editor/contrib/ # Editor features
├── platform/ # Platform services
└── workbench/ # Main UI components
test/ # Integration tests
out/ # Compiled output
scripts/ # Build and test scripts