Co-authored-by: OpenHands-Gemini <openhands@all-hands.dev> Co-authored-by: Claude 3.5 Sonnet <claude-3-5-sonnet@anthropic.com>
2.9 KiB
VSCode Extension Development
This document provides instructions for developing and contributing to the OpenHands VSCode extension.
Setup
To get started with development, you need to install the dependencies.
npm install
Building the Extension
The VSCode extension is automatically built during the main OpenHands pip install process. However, you can also build it manually.
-
Package the extension: This creates a
.vsixfile that can be installed in VSCode.npm run package-vsix -
Compile TypeScript: This compiles the source code without creating a package.
npm run compile
Code Quality and Testing
We use ESLint, Prettier, and TypeScript for code quality.
-
Run linting with auto-fixes:
npm run lint:fix -
Run type checking:
npm run typecheck -
Run tests:
npm run test
Releasing a New Version
The extension has its own version number and is released independently of the main OpenHands application. The release process is automated via the vscode-extension-build.yml GitHub Actions workflow and is triggered by pushing a specially formatted Git tag.
1. Update the Version Number
Before creating a release, you must first bump the version number in the extension's package.json file.
- Open
openhands/integrations/vscode/package.json. - Find the
"version"field and update it according to Semantic Versioning (e.g., from"0.0.1"to"0.0.2").
2. Commit the Version Bump
Commit the change to package.json with a clear commit message.
git add openhands/integrations/vscode/package.json
git commit -m "chore(vscode): bump version to 0.0.2"
3. Create and Push the Tag
The release is triggered by a Git tag that must match the version in package.json and be prefixed with ext-v.
-
Create an annotated tag. The tag name must be
ext-vfollowed by the version number you just set.# Example for version 0.0.2 git tag -a ext-v0.0.2 -m "Release VSCode extension v0.0.2" -
Push the commit and the tag to the
upstreamremote.# Push the branch with the version bump commit git push upstream <your-branch-name> # Push the specific tag git push upstream ext-v0.0.2
4. Finalize the Release on GitHub
Pushing the tag will automatically trigger the VSCode Extension CI workflow. This workflow will:
- Build the
.vsixfile. - Create a new draft release on GitHub with the
.vsixfile attached as an asset.
To finalize the release:
- Go to the "Releases" page of the OpenHands repository on GitHub.
- Find the new draft release (e.g.,
ext-v0.0.2). - Click "Edit" to write the release notes, describing the new features and bug fixes.
- Click the "Publish release" button.
The release is now public and available for users.