Skip to content

Contributing

Welcome to the Tombo project! We're excited to have you contribute to making Python package management in VS Code even better.

Quick Start

Ready to contribute? Here's how to get started:

  1. Fork the repository on GitHub
  2. Clone your fork locally
  3. Set up the development environment
  4. Make your changes
  5. Submit a pull request

Development Environment

Prerequisites

  • Node.js 16+ - JavaScript runtime
  • Python 3.8+ - For Python LSP components
  • Git - Version control
  • VS Code - For testing the extension

Setup Steps

  1. Clone the repository:

    git clone https://github.com/your-username/tombo.git
    cd tombo
    

  2. Install dependencies:

    # Install Node.js dependencies
    npm install
    
    # Install Python dependencies (optional, for LSP development)
    pip install -r requirements.txt
    

  3. Build the extension:

    # Compile TypeScript
    npm run compile
    
    # Or watch for changes during development
    npm run watch
    

  4. Test in VS Code:

  5. Open the project in VS Code
  6. Press F5 to launch Extension Development Host
  7. Test Tombo features in the new VS Code window

Project Structure

Understanding the codebase:

tombo/
โ”œโ”€โ”€ src/                          # TypeScript source code
โ”‚   โ”œโ”€โ”€ extension.ts              # Main extension entry point
โ”‚   โ”œโ”€โ”€ api/                      # PyPI API integration
โ”‚   โ”‚   โ”œโ”€โ”€ clients/              # HTTP client and networking
โ”‚   โ”‚   โ”œโ”€โ”€ services/             # Core PyPI service
โ”‚   โ”‚   โ”œโ”€โ”€ cache/                # Smart caching system
โ”‚   โ”‚   โ””โ”€โ”€ types/                # API type definitions
โ”‚   โ”œโ”€โ”€ providers/                # VS Code language providers
โ”‚   โ”‚   โ”œโ”€โ”€ hover-provider.ts     # Rich hover information
โ”‚   โ”‚   โ”œโ”€โ”€ version-completion-provider.ts  # Version completion
โ”‚   โ”‚   โ””โ”€โ”€ quick-action.ts       # Right-click actions
โ”‚   โ”œโ”€โ”€ core/                     # Core utilities
โ”‚   โ”‚   โ”œโ”€โ”€ config/               # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ errors/               # Error handling
โ”‚   โ”‚   โ””โ”€โ”€ logging/              # Logging system
โ”‚   โ””โ”€โ”€ toml/                     # TOML parsing
โ”œโ”€โ”€ docs/                         # Documentation (this site)
โ”œโ”€โ”€ tests/                        # Test projects and examples
โ”œโ”€โ”€ package.json                  # Extension manifest
โ”œโ”€โ”€ tsconfig.json                 # TypeScript configuration
โ””โ”€โ”€ webpack.config.js             # Build configuration

Development Workflow

Making Changes

  1. Create a feature branch:

    git checkout -b feature/your-feature-name
    

  2. Make your changes in the appropriate files

  3. Test locally using the Extension Development Host
  4. Run tests and linting:
    npm run lint          # Check code style
    npm run compile       # Verify TypeScript compilation
    npm run test          # Run extension tests
    

Testing Your Changes

Manual Testing: 1. Press F5 in VS Code to launch Extension Development Host 2. Open test files from tests/ directory: - tests/pep621/pyproject.toml - PEP 621 format - tests/poetry_v1/pyproject.toml - Poetry v1 format - tests/poetry_v2/pyproject.toml - Poetry v2 format 3. Test hover and completion features 4. Check the Output panel for any errors

Automated Testing:

# Run TypeScript compilation
npm run compile

# Run linting
npm run lint

# Run extension tests (requires compilation first)
npm run pretest && npm run test

Code Style and Standards

TypeScript Guidelines

Code Style:

  • Use TypeScript strict mode
  • Follow semantic naming conventions
  • Add JSDoc comments for public APIs
  • Use async/await instead of Promises where possible

Example:

/**
 * Fetches package metadata from PyPI with intelligent caching
 * @param packageName - The name of the package to fetch
 * @param includePreReleases - Whether to include pre-release versions
 * @returns Promise resolving to package metadata
 * @throws {PackageNotFoundError} When package doesn't exist on PyPI
 */
async getPackageMetadata(
    packageName: string,
    includePreReleases: boolean = false
): Promise<PackageMetadata> {
    // Implementation here
}

Error Handling:

  • Use structured error types from src/core/errors/
  • Always handle network failures gracefully
  • Provide meaningful error messages to users

Performance:

  • Prefer caching over repeated API calls
  • Use lazy loading for expensive operations
  • Minimize extension activation impact

Linting Configuration

The project uses ESLint with TypeScript support:

# Check linting
npm run lint

# Fix auto-fixable issues
npm run lint -- --fix

Key linting rules:

  • Semicolons required
  • No unused variables
  • Consistent indentation (2 spaces)
  • Prefer const over let where possible

Contributing Areas

๐ŸŽฏ High-Impact Contributions

Feature Enhancements:

  • Improve version completion algorithms
  • Add support for new package formats
  • Enhance caching strategies
  • Optimize performance

User Experience:

  • Better error messages and recovery
  • Improved visual indicators
  • Enhanced hover information
  • Accessibility improvements

Documentation:

  • Code examples and tutorials
  • Video demonstrations
  • Troubleshooting guides
  • API documentation

๐Ÿงช Technical Improvements

Architecture:

  • Refactor providers for better maintainability
  • Improve TypeScript type definitions
  • Enhance error handling patterns
  • Optimize bundle size

Testing:

  • Unit tests for core functionality
  • Integration tests for VS Code features
  • Performance benchmarks
  • Edge case testing

Infrastructure:

  • CI/CD improvements
  • Release automation
  • Security scanning
  • Documentation generation

Pull Request Process

Before Submitting

  1. Ensure tests pass:

    npm run pretest && npm test
    

  2. Check code quality:

    npm run lint
    npm run compile
    

  3. Test manually in Extension Development Host

  4. Update documentation if needed
  5. Write descriptive commit messages

PR Requirements

Title Format: - feat: add support for Pipfile format - fix: resolve hover timeout issues - docs: update installation guide - perf: optimize caching performance

Description Should Include: - What - Clear description of changes - Why - Motivation and context - How - Technical approach taken - Testing - How you verified the changes - Screenshots - For UI changes

PR Template:

## What Changed
Brief description of your changes.

## Why
Explain the motivation for these changes.

## How
Technical details of your implementation.

## Testing
- [ ] Manual testing in Extension Development Host
- [ ] All existing tests pass
- [ ] Added new tests for new functionality

## Screenshots (if applicable)
Include before/after screenshots for UI changes.

## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Tests added/updated

Review Process

  1. Automated checks run on all PRs
  2. Code review by maintainers
  3. Testing in various environments
  4. Merge after approval

Review criteria: - Code quality and maintainability - Performance impact - User experience - Security considerations - Compatibility with existing features

Issue Reporting

Bug Reports

Good bug reports include: - Tombo version and VS Code version - Operating system and version - Clear steps to reproduce - Expected vs actual behavior - Screenshots or videos if helpful - Debug logs if relevant

Bug Report Template:

**Environment**
- Tombo version: 1.0.0
- VS Code version: 1.84.0
- OS: Windows 11

**Steps to Reproduce**
1. Open pyproject.toml file
2. Hover over package name
3. No hover information appears

**Expected Behavior**
Rich package metadata should appear in hover tooltip.

**Actual Behavior**
No hover response, nothing happens.

**Additional Context**
- Network connectivity is good
- Other VS Code extensions work fine
- Debug logs attached

Feature Requests

Feature request template:

**Is your feature request related to a problem?**
A clear description of what the problem is.

**Describe the solution you'd like**
A clear description of what you want to happen.

**Describe alternatives you've considered**
Alternative solutions or features you've considered.

**Additional context**
Screenshots, mockups, or examples.

Development Guidelines

Performance Considerations

Caching Strategy: - Cache expensive PyPI lookups - Use appropriate TTL values - Implement cache invalidation - Monitor memory usage

Network Requests: - Implement retry logic with backoff - Handle network failures gracefully - Respect rate limits - Use efficient HTTP clients

VS Code Integration: - Minimize extension activation time - Use lazy loading for providers - Dispose resources properly - Follow VS Code best practices

Security Guidelines

Network Security: - Validate all external inputs - Use HTTPS for PyPI requests - Handle SSL/certificate issues - Sanitize user-provided URLs

Data Handling: - Don't store sensitive information - Respect user privacy - Follow minimal data collection principles - Clear sensitive data from logs

Community Guidelines

Code of Conduct

We follow the Contributor Covenant code of conduct:

  • Be respectful - Treat everyone with respect
  • Be inclusive - Welcome diverse perspectives
  • Be constructive - Provide helpful feedback
  • Be patient - Remember we're all learning

Communication

Preferred channels: - GitHub Issues - Bug reports and feature requests - GitHub Discussions - Questions and community discussion - Pull Requests - Code contributions and reviews

Communication tips: - Be clear and concise - Provide context and examples - Be open to feedback - Help others when you can

Recognition

Contributors

All contributors are recognized in: - README.md - Contributors section - Release notes - Feature credits - Documentation - Author attribution - GitHub - Contributor graphs

Ways to Contribute

You don't need to write code to contribute:

  • ๐Ÿ“ Documentation - Improve guides and examples
  • ๐Ÿ› Bug reports - Help identify issues
  • ๐Ÿ’ก Feature ideas - Suggest improvements
  • ๐Ÿงช Testing - Test new features and releases
  • โ“ Support - Help other users in discussions
  • ๐ŸŽจ Design - UI/UX improvements
  • ๐Ÿ“น Content - Videos, tutorials, blog posts

Getting Help

Development Questions

Stuck on something? 1. Check the troubleshooting guide 2. Search existing GitHub issues 3. Ask in GitHub Discussions 4. Reach out to maintainers

Resources

Useful links: - VS Code Extension API - Official VS Code docs - TypeScript Handbook - TypeScript reference - PyPI API - PyPI API documentation - PEP 621 - Python packaging standards

Release Process

Versioning

We use Semantic Versioning: - Major (1.0.0) - Breaking changes - Minor (1.1.0) - New features, backward compatible - Patch (1.1.1) - Bug fixes, backward compatible

Release Schedule

  • Patch releases - As needed for critical bugs
  • Minor releases - Monthly feature releases
  • Major releases - When breaking changes are needed

Thank You! ๐ŸŽ‰

Every contribution makes Tombo better for the Python development community. Whether you're fixing a typo in documentation or implementing a major feature, your help is valued and appreciated.

Ready to contribute? Fork the repository and dive in!


Questions?

Don't hesitate to ask! We're here to help you succeed. Check our GitHub Discussions or reach out to the maintainers.