- Fork and clone the repository
- Install dependencies:
pnpm install - Open the project in VSCode
- Launch the Extension Development Host by pressing
F5or running "Debug: Start Debugging" from the command palette
- Create feature branches from
main - Use descriptive branch names like
feature/add-blame-annotationsorfix/remote-url-parsing - Do not commit directly to
main
Commit messages should follow the Conventional Commits format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Common types include feat, fix, docs, style, refactor, test, build, ci, chore.
This project uses Prettier for formatting with the following key settings:
- No semicolons
- Double quotes
- Trailing commas
Run pnpm run format to format all files, or configure your editor to format on save. The .vscode/settings.json file includes the recommended settings for VSCode.
Run pnpm run lint to verify formatting without modifying files.
src/
├── __tests__/ # Unit tests (Mocha, tdd UI)
├── commands/ # VSCode command handlers
├── git/ # Git abstraction layer
│ ├── models.ts # TypeScript interfaces for Git objects
│ ├── shell.ts # Git subprocess execution
│ ├── parsers.ts # Raw git output parsers
│ ├── remoteUrls.ts # Remote URL generation per provider
│ └── gitService.ts # High-level Git service
├── views/ # Tree view data providers
│ ├── nodes.ts # Tree node classes
│ ├── groupedView.ts # Grouped SCM view (single TreeView with toggle buttons)
│ └── *View.ts # One file per sub-view
├── config.ts # Configuration helpers
├── constants.ts # Extension IDs, command IDs, context values
├── container.ts # Dependency injection container
└── extension.ts # Extension entry point (activate/deactivate)
tests/
└── e2e/ # End-to-end tests (VS Code test host)
- Add the command ID to
src/constants.tsin theCommandsobject - Register the command handler in
src/commands/registerCommands.ts - Declare the command in
package.jsonundercontributes.commands - Add menu entries in
package.jsonundercontributes.menusif the command should appear in context menus or inline toolbars - If the command should be hidden from the command palette, add it to the
commandPalettemenu entries with"when": "false"
- Add the view ID to
src/constants.tsin theViewIdsenum - Create a new view class in
src/views/implementingvscode.TreeDataProvider - Export it from
src/views/index.ts - Instantiate it in
src/container.ts - Declare the view in
package.jsonundercontributes.views
- Add the provider ID to the
RemoteProviderIdtype insrc/git/models.ts - Add domain detection in
identifyProvider()insrc/git/parsers.ts - Add URL generation in the switch statements in
src/git/remoteUrls.ts - Add tests in
src/__tests__/remoteUrls.test.ts
Unit tests use Mocha with the tdd UI (using suite and test instead of describe and it) and run inside the VSCode test host via @vscode/test-cli.
pnpm run testTest files are located in src/__tests__/ and follow the naming convention *.test.ts.
End-to-end tests use the VSCode test host via @vscode/test-cli.
pnpm run test:e2eE2E test specs are in tests/e2e/specs/.
- Test pure logic (parsers, URL generation, configuration) with unit tests
- Test VSCode integration (commands, views, tree data providers) with E2E tests where possible
- Keep tests focused and independent
pnpm run build # Production build (minified)
pnpm run build:dev # Development build (with sourcemaps)
pnpm run package # Create .vsix packageThe build uses esbuild to bundle src/extension.ts into dist/extension.js. The vscode module is marked as external since it's provided by the VSCode runtime.
- Keep PRs focused on a single change
- Include tests for new functionality
- Ensure
pnpm run lintandpnpm run buildpass - Describe what the change does and why in the PR description
Releases are fully automated with semantic-release. When commits land on main, semantic-release:
- Analyzes commit messages to determine the next version bump
- Generates release notes and updates
CHANGELOG.md - Bumps the version in
package.json - Publishes the
.vsixto both the VS Code Marketplace and Open VSX - Creates a GitHub release with the
.vsixattached - Commits the updated
CHANGELOG.mdandpackage.jsonback tomain
Version bumps follow Semantic Versioning:
fix:commits -> patch release (0.1.0 -> 0.1.1)feat:commits -> minor release (0.1.0 -> 0.2.0)BREAKING CHANGE:in commit body/footer -> major release (0.1.0 -> 1.0.0)
No manual version bumps, tags, or changelog edits are needed.
Note that, even if the VSCode extension is published as a pre-release, the branch and tag name should not include SemVer pre-release specifiers because the Microsoft marketplace does not support them. The docs explain,
We only support
major.minor.patchfor extension versions,semverpre-release tags are not supported. Versions must be different between pre-release and regular releases. That is, if1.2.3is uploaded as a pre-release, the next regular release must be uploaded with a distinct version, such as1.2.4. Fullsemversupport will be available in the future.