Contributing to VS Code Groovy Extension
January 8, 2026 · View on GitHub
Thank you for your interest in contributing to the Groovy Language Support extension for Visual Studio Code!
Development Setup
Prerequisites
- Node.js 20+: For extension development
- Java 17+: Required for the Groovy Language Server
- VS Code: For testing the extension
- Git: For version control
Getting Started
-
Clone the repository
git clone https://github.com/albertocavalcante/gvy.git cd gvy -
Install dependencies
pnpm install -
Prepare the Groovy Language Server
pnpm run prepare-server -
Compile the extension
pnpm run compile
Development Workflow
Project Structure
gvy/
├── client/src/ # Extension source code
│ ├── commands/ # VS Code commands
│ ├── configuration/ # Configuration management
│ ├── java/ # Java detection and management
│ ├── server/ # Language Server client
│ ├── ui/ # UI components (status bar, etc.)
│ └── extension.ts # Main extension entry point
├── server/ # Language Server JAR
├── syntaxes/ # TextMate grammars
└── tools/ # Build and setup scripts
Available Scripts
pnpm run compile- Compile TypeScript and bundle with esbuildpnpm run watch- Watch mode for developmentpnpm run lint- Run ESLintpnpm run check-types- TypeScript type checkingpnpm run package- Build and package VSIXpnpm run prepare-server- Download/prepare Groovy Language Server
Updating the Pinned LSP Version
When a new stable LSP version is released:
-
Update
editors/code/tools/prepare-server.js:PINNED_RELEASE_TAG = "v0.x.y"PINNED_JAR_ASSET = "gls-0.x.y.jar"PINNED_DOWNLOAD_URL = ...PINNED_JAR_SHA256 = "..."(get from release checksums.txt)
-
Update
editors/code/AGENTS.md:- Update "Pinned LSP" line with new version
-
Test fallback behavior:
GLS_USE_PINNED=true pnpm run prepare-server
Note: Users get the latest release by default. The pinned version serves as:
- Fallback for network issues (with
GLS_ALLOW_PINNED_FALLBACK=true) - Explicit stability option (with
GLS_USE_PINNED=true) - Emergency escape hatch if latest has critical bugs
Testing the Extension
-
Open in VS Code
code . -
Launch Extension Development Host
- Press
F5or go to Run → Start Debugging - This opens a new VS Code window with your extension loaded
- Press
-
Test with Groovy files
- Create or open
.groovy,.gradle, orJenkinsfilefiles - Verify language features work (syntax highlighting, completion, etc.)
- Create or open
-
Check the Output panel
- View → Output → Select "Groovy Language Server"
- Monitor for any errors or issues
Code Quality
We enforce code quality through automated checks:
- ESLint: Code style and potential issues
- TypeScript: Type safety
- Bundle size: Must stay under 2MB
Run quality checks:
pnpm run lint
pnpm run check-types
Making Changes
Commit Guidelines
We use Conventional Commits for automated version management:
feat:- New feature (minor version bump)fix:- Bug fix (patch version bump)feat!:orfix!:- Breaking change (major version bump)docs:- Documentation changeschore:- Maintenance tasksrefactor:- Code refactoringtest:- Adding tests
Examples:
git commit -m "feat: add Gradle task provider integration"
git commit -m "fix: resolve Java detection on Windows"
git commit -m "docs: update configuration examples"
Pull Request Process
-
Create a feature branch
git checkout -b feature/your-feature-name -
Make your changes
- Follow existing code patterns
- Add appropriate error handling
- Update documentation if needed
-
Test locally
pnpm run compile pnpm run lint pnpm run check-types -
Create a pull request
- Include a clear description
- Reference any related issues
- Ensure CI checks pass
CI/CD Pipeline
Our automated pipeline includes:
- PR Checks: Lint, type check, build, bundle size validation
- Multi-platform testing: Linux, Windows, macOS
- Automatic releases: Via Release Please when PRs are merged
Architecture Guidelines
Extension Architecture
- Modular design: Separate concerns into focused modules
- Error handling: Graceful degradation with helpful error messages
- Configuration: Reactive to VS Code setting changes
- Performance: Minimal startup impact, efficient resource usage
Language Server Integration
- Robust connection handling: Automatic restart capabilities
- Java runtime detection: Support multiple Java installations
- Server lifecycle management: Proper startup, shutdown, restart
Adding New Features
- Commands: Add to
client/src/commands/ - Configuration: Update
package.jsoncontributes section - UI Elements: Add to
client/src/ui/ - Server Communication: Extend
client/src/server/
Testing
Automated Testing
We use automated tests to ensure the quality of the extension.
Running All Tests To run both unit and integration tests:
pnpm run test:all
Note: Integration tests on Linux require xvfb. Using the CI environment or a Docker container is recommended for
headless testing.
Running Unit Tests Unit tests cover individual components in isolation:
pnpm test
Running Integration Tests Integration tests run within a VS Code Extension Host instance:
pnpm run test:integration
Debugging Tests You can debug tests directly in VS Code:
- Open the Debug view (
Cmd+Shift+D/Ctrl+Shift+D). - Select "Extension Tests" from the configuration dropdown.
- Press
F5to start debugging.
Manual Testing Checklist
- Extension activates without errors
- Groovy files are recognized and highlighted
- Language server starts successfully
- Code completion works
- Diagnostics appear for syntax errors
- Commands execute without errors
- Settings changes are applied
- Extension deactivates cleanly
File Type Testing
Test with these file types:
.groovy- General Groovy scripts.gradle- Gradle build filesJenkinsfile- Jenkins Pipeline files.gvy,.gy,.gsh- Alternative Groovy extensions
Platform Testing
Verify functionality on:
- Linux (primary CI platform)
- Windows (path separator handling, Java detection)
- macOS (Java detection, file permissions)
Troubleshooting Development Issues
Extension Won't Start
- Check VS Code Developer Console (
Help → Toggle Developer Tools) - Verify Java 17+ is installed:
java -version - Check Groovy Language Server JAR exists:
ls -la server/gls.jar - Review extension output panel
Build Issues
- Clean build:
rm -rf node_modules client/node_modules && pnpm install - Reset server:
rm server/*.jar && pnpm run prepare-server - Check Node.js version:
node --version(should be 20+)
Language Server Issues
- Check Java installation and PATH
- Verify server JAR integrity
- Review server logs in Output panel
- Try manual server restart:
Groovy: Restart Server
Getting Help
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Check the README and CI/CD Setup
Release Process
Releases are automated through Release Please:
- Make changes using conventional commits
- Release Please creates/updates a release PR
- Review the generated changelog
- Merge the release PR
- Extension is automatically published to VS Code Marketplace
Thank you for contributing to making Groovy development in VS Code better!