|
| 1 | +# Contributing to LSP Client |
| 2 | + |
| 3 | +Thank you for your interest in contributing to lsp-client! 🎉 |
| 4 | + |
| 5 | +## Why Your Contribution Matters |
| 6 | + |
| 7 | +This project is unique in its ambitious scope: **we aim to provide production-ready Python clients for every major language server**, each with its own intricate protocol details, configuration quirks, and containerization requirements. |
| 8 | + |
| 9 | +**We need your help!** The LSP Client project interfaces with numerous upstream projects: |
| 10 | + |
| 11 | +- **Language Servers**: Pyright, Rust-Analyzer, TypeScript, Deno, Pyrefly, and many more to come |
| 12 | +- **LSP Protocol**: The ever-evolving LSP 3.17+ specification with 50+ capabilities |
| 13 | +- **Container Ecosystems**: Docker/Podman images, version management, and build systems |
| 14 | +- **Upstream Dependencies**: npm packages, PyPI distributions, GitHub releases |
| 15 | + |
| 16 | +Each integration requires: |
| 17 | +- Deep understanding of the specific language server's capabilities and behavior |
| 18 | +- Careful testing across different environments (local, container, multi-workspace) |
| 19 | +- Maintaining compatibility as upstream projects evolve |
| 20 | +- Documenting edge cases and configuration options |
| 21 | + |
| 22 | +**No single maintainer can keep up with all these moving parts.** Your expertise with specific language servers, protocols, or use cases is invaluable. Whether you use Rust, Python, TypeScript, or any other language, you have unique insights that can improve this project for everyone. |
| 23 | + |
| 24 | +## How You Can Help |
| 25 | + |
| 26 | +We welcome all kinds of contributions: |
| 27 | + |
| 28 | +### 🚀 Add Support for New Language Servers |
| 29 | + |
| 30 | +Know a language server that would benefit the community? We'd love to integrate it! See our detailed guide: |
| 31 | + |
| 32 | +**→ [How to Add Support for a New LSP Server](docs/contribution/how-to-add-new-servers.md)** |
| 33 | + |
| 34 | +Common servers we'd love to see: |
| 35 | +- **Go**: gopls |
| 36 | +- **Java**: Eclipse JDT, jdtls |
| 37 | +- **C/C++**: clangd |
| 38 | +- **Ruby**: Solargraph, Sorbet |
| 39 | +- **PHP**: Intelephense |
| 40 | +- **And many more!** |
| 41 | + |
| 42 | +### 🧩 Implement LSP Capabilities |
| 43 | + |
| 44 | +The LSP specification includes 50+ capabilities. We've implemented the most common ones, but there's much more to do: |
| 45 | + |
| 46 | +**→ [How to Add a New LSP Capability](docs/contribution/how-to-add-new-capabilities.md)** |
| 47 | + |
| 48 | +Capabilities we need: |
| 49 | +- **textDocument/inlayHint** - inline type hints |
| 50 | +- **textDocument/inlineValue** - debugger inline values |
| 51 | +- **textDocument/colorPresentation** - color picker support |
| 52 | +- **textDocument/linkedEditingRange** - rename refactoring |
| 53 | +- **workspace/symbol** - project-wide symbol search |
| 54 | +- And more from the [LSP 3.17 spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) |
| 55 | + |
| 56 | +### 🐳 Improve Container Support |
| 57 | + |
| 58 | +Help us maintain and improve our container images: |
| 59 | +- Update versions in `registry/wiki.toml` |
| 60 | +- Optimize Dockerfiles for smaller image sizes |
| 61 | +- Add new base images for different environments |
| 62 | +- Improve cross-platform compatibility |
| 63 | + |
| 64 | +### 📚 Documentation & Examples |
| 65 | + |
| 66 | +- Write tutorials for specific use cases |
| 67 | +- Add examples for your favorite language server |
| 68 | +- Improve API documentation |
| 69 | +- Translate documentation to other languages |
| 70 | + |
| 71 | +### 🐛 Bug Reports & Testing |
| 72 | + |
| 73 | +- Report issues with specific language servers |
| 74 | +- Test edge cases in your environment |
| 75 | +- Improve test coverage |
| 76 | +- Share your integration experiences |
| 77 | + |
| 78 | +### 💡 Feature Requests & Discussion |
| 79 | + |
| 80 | +Have ideas for improving the API? Want to discuss architecture decisions? Open an issue or start a discussion! |
| 81 | + |
| 82 | +## Getting Started |
| 83 | + |
| 84 | +### Development Setup |
| 85 | + |
| 86 | +1. **Clone the repository**: |
| 87 | + ```bash |
| 88 | + git clone https://github.com/observerw/lsp-client.git |
| 89 | + cd lsp-client |
| 90 | + ``` |
| 91 | + |
| 92 | +2. **Install dependencies** (we recommend [uv](https://github.com/astral-sh/uv)): |
| 93 | + ```bash |
| 94 | + uv sync --all-extras |
| 95 | + ``` |
| 96 | + |
| 97 | +3. **Set up pre-commit hooks**: |
| 98 | + ```bash |
| 99 | + uv run pre-commit install |
| 100 | + ``` |
| 101 | + |
| 102 | +### Development Workflow |
| 103 | + |
| 104 | +See [AGENTS.md](AGENTS.md) for detailed development commands: |
| 105 | + |
| 106 | +```bash |
| 107 | +# Lint & format |
| 108 | +ruff check --fix && ruff format |
| 109 | + |
| 110 | +# Type checking |
| 111 | +mypy src/ |
| 112 | + |
| 113 | +# Run tests |
| 114 | +pytest # All tests |
| 115 | +pytest -m unit # Unit tests only |
| 116 | +pytest -m integration # Integration tests |
| 117 | +pytest path/to/test.py::test_function # Single test |
| 118 | +``` |
| 119 | + |
| 120 | +### Code Style |
| 121 | + |
| 122 | +- **Python 3.12+** required |
| 123 | +- Use `from __future__ import annotations` in all files |
| 124 | +- Follow [PEP 8](https://peps.python.org/pep-0008/) (enforced by ruff) |
| 125 | +- Full type annotations required (checked by mypy) |
| 126 | +- Write clear docstrings for public APIs |
| 127 | + |
| 128 | +### Commit Guidelines |
| 129 | + |
| 130 | +- Write clear, descriptive commit messages |
| 131 | +- Use conventional commits format: |
| 132 | + - `feat:` new features |
| 133 | + - `fix:` bug fixes |
| 134 | + - `docs:` documentation changes |
| 135 | + - `test:` test additions/changes |
| 136 | + - `refactor:` code refactoring |
| 137 | + - `chore:` maintenance tasks |
| 138 | + |
| 139 | +Examples: |
| 140 | +``` |
| 141 | +feat(lsp): add support for gopls language server |
| 142 | +fix(container): resolve path translation issue in Windows |
| 143 | +docs: add tutorial for rust-analyzer integration |
| 144 | +test: add integration tests for multi-root workspaces |
| 145 | +``` |
| 146 | + |
| 147 | +## Pull Request Process |
| 148 | + |
| 149 | +1. **Fork the repository** and create a branch from `main` |
| 150 | +2. **Make your changes** following the code style guidelines |
| 151 | +3. **Add tests** for new functionality |
| 152 | +4. **Update documentation** as needed |
| 153 | +5. **Ensure all tests pass**: `pytest` |
| 154 | +6. **Run linting**: `ruff check --fix && ruff format` |
| 155 | +7. **Submit a pull request** with a clear description of your changes |
| 156 | + |
| 157 | +### PR Checklist |
| 158 | + |
| 159 | +- [ ] Tests added/updated and passing |
| 160 | +- [ ] Documentation updated |
| 161 | +- [ ] Code follows style guidelines (ruff, mypy) |
| 162 | +- [ ] Commit messages are clear and descriptive |
| 163 | +- [ ] PR description explains the motivation and changes |
| 164 | + |
| 165 | +## Need Help? |
| 166 | + |
| 167 | +- **Questions?** Open a [Discussion](https://github.com/observerw/lsp-client/discussions) |
| 168 | +- **Bug reports?** Open an [Issue](https://github.com/observerw/lsp-client/issues) |
| 169 | +- **Want to chat?** Reach out in the Issues or Discussions |
| 170 | + |
| 171 | +## Recognition |
| 172 | + |
| 173 | +All contributors will be recognized in our release notes and documentation. We deeply appreciate every contribution, no matter how small! |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +**Remember**: Every language server you help integrate, every capability you implement, and every bug you fix makes this library better for the entire Python community. Your contribution has real impact! 🚀 |
0 commit comments