Development Setup¶
Set up your environment to contribute to the BerryCrush VS Code extension.
Prerequisites¶
- Node.js: Version 18 or higher
- npm: Comes with Node.js
- VS Code: Latest version recommended
- Git: For version control
Getting Started¶
Clone the Repository¶
Install Dependencies¶
Build the Extension¶
Run in Development Mode¶
- Open the
vscodefolder in VS Code - Press F5 to launch the Extension Development Host
- A new VS Code window opens with the extension loaded
- Make changes to the code
- Press Ctrl+Shift+F5 to reload
Project Structure¶
vscode/
├── src/
│ ├── extension.ts # Extension entry point
│ ├── completion-provider.ts # Auto-completion
│ ├── definition-provider.ts # Go to definition
│ ├── document-link-provider.ts # Clickable links
│ ├── folding-provider.ts # Code folding
│ ├── formatting-provider.ts # Document formatting
│ ├── hover-provider.ts # Hover information
│ ├── reference-provider.ts # Find references
│ ├── symbol-provider.ts # Document symbols
│ ├── fragment-provider.ts # Fragment discovery
│ ├── openapi-provider.ts # OpenAPI parsing
│ └── step-provider.ts # Custom step discovery
├── syntaxes/
│ └── berrycrush.tmLanguage.json # Syntax highlighting
├── snippets/
│ └── berrycrush.code-snippets # Code snippets
├── resources/
│ └── icons/ # File icons
├── doc/ # Documentation
├── package.json # Extension manifest
├── tsconfig.json # TypeScript config
└── .eslintrc.json # ESLint config
Development Commands¶
| Command | Description |
|---|---|
npm run compile |
Compile TypeScript |
npm run watch |
Watch mode (auto-compile) |
npm run lint |
Run ESLint |
npm test |
Run tests |
npm run package |
Build VSIX package |
Testing¶
Run Tests¶
Tests run in a VS Code instance using @vscode/test-electron.
Debug Tests¶
- Open the Test Explorer view
- Click the debug icon next to a test
- Breakpoints work in test code
Debugging¶
Launch Configuration¶
The .vscode/launch.json includes configurations for:
- Run Extension: Launch development host
- Extension Tests: Run test suite
Debug Output¶
Use console.log() or the VS Code Output channel:
const outputChannel = vscode.window.createOutputChannel('BerryCrush');
outputChannel.appendLine('Debug message');
outputChannel.show();
Building a VSIX¶
Package the extension for distribution:
This creates berrycrush-x.x.x.vsix.
Code Style¶
- Follow existing code patterns
- Run
npm run lintbefore committing - Use TypeScript strict mode
- Add JSDoc comments for public APIs
Next Steps¶
- Architecture - Understand the codebase
- Contributing - Contribution guidelines