Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Full-featured, well-typed, and easy-to-use LSP client

License

observerw/lsp-client

Repository files navigation

LSP-Client

A full-featured, well-typed, and easy-to-use Python LSP client library that provides a high-level interface to interact with Language Server Protocol servers.

Python Version License: MIT Code style: ruff

🚀 Quick Start

Installation

uv add lsp-client

Basic Usage

from pathlib import Path
from lsp_client import Position
from lsp_client.clients.based_pyright import BasedPyrightClient

async def main():
    async with BasedPyrightClient(workspace="/path/to/my/project") as client:
        # Find references
        refs = await client.request_references(
            file_path="main.py",
            position=Position(line=10, character=5)
        )

        if not refs:
            print("No references found")
            return

        for ref in refs:
            print(f"Found reference: {ref.uri} at {ref.range}") 

        # Get document symbols
        symbols = await client.request_document_symbols("main.py")

📁 Project Structure

src/lsp_client/
├── client/           # Client base classes and utilities
├── server/           # Server base classes and process management
├── capability/       # LSP capability groups and protocols
├── clients/          # Server-specific client implementations
└── utils/            # Shared utilities

🤝 Contributing

Contributions are welcome! Please check the contribution guide for more information.

📄 License

This project is licensed under the MIT License.

🔗 Related Links


Making LSP integration simple and powerful! 🚀

About

Full-featured, well-typed, and easy-to-use LSP client

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published