Skip to content

Commit 38bb3d2

Browse files
committed
doc: update README
1 parent a325634 commit 38bb3d2

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ A production-ready, async-first Python client for the Language Server Protocol (
1111

1212
`lsp-client` is engineered for developers building **production-grade tooling** that requires precise control over language server environments:
1313

14-
- **🐳 Container-First Architecture**: Containers as first-class citizens with workspace mounting, path translation, and lifecycle management. Pre-built images available, seamless switching between local and container environments.
1514
- **🧩 Intelligent Capability Management**: Zero-overhead mixin system with automatic registration, negotiation, and availability checks. Only access methods for registered capabilities.
16-
- **🎯 Complete LSP 3.17 Support**: Full specification implementation with pre-configured clients for Pyright, Rust-Analyzer, Deno, TypeScript, and Pyrefly.
15+
- **🎯 Complete LSP 3.17 Support**: Full specification implementation with pre-configured clients for multiple popular language servers. Easily extendable for custom servers and capabilities.
16+
- **🐳 Container-First Architecture**: Containers as first-class citizens with workspace mounting, path translation, and lifecycle management. Pre-built images available, seamless switching between local and container environments.
1717
- **⚡ Production-Ready & Modern**: Explicit environment control with no auto-downloads. Built with async patterns, comprehensive error handling, retries, and full type safety.
1818

1919
## Quick Start
@@ -50,7 +50,7 @@ async def main():
5050
anyio.run(main)
5151
```
5252

53-
### Container-based Language Server
53+
### Containerized Language Server
5454

5555
```python
5656
async def main():
@@ -85,7 +85,36 @@ Run examples with:
8585
uv run examples/pyright_docker.py
8686
```
8787

88-
## Supported Language Servers
88+
## Client Definition
89+
90+
Defining a custom client is super easy with the capability mixin:
91+
92+
```python
93+
@define
94+
class MyPythonClient(
95+
Client,
96+
WithRequestHover, # textDocument/hover
97+
WithRequestDefinition, # textDocument/definition
98+
WithRequestReferences, # textDocument/references
99+
WithNotifyDidChangeConfiguration, # workspace/didChangeConfiguration
100+
# ... and other capabilities as needed
101+
):
102+
def create_default_servers(self) -> DefaultServers:
103+
return DefaultServers(
104+
# support both local ...
105+
local=LocalServer(program="pylsp", args=["--stdio"]),
106+
# ... and containerized server!
107+
container=ContainerServer(image="ghcr.io/observerw/lsp-client/python-lsp-server")
108+
)
109+
110+
def create_initialization_options(self) -> dict:
111+
return {"plugins": {"pyflakes": {"enabled": True}}} # custom init options
112+
113+
def check_server_compatibility(self, info: lsp_type.ServerInfo | None) -> None:
114+
return # Custom compatibility checks if needed
115+
```
116+
117+
## Current Supported Language Servers
89118

90119
| Language Server | Module Path | Language | Container Image |
91120
| -------------------------- | ---------------------------------- | --------------------- | -------------------------------------------- |

0 commit comments

Comments
 (0)