LSP Client in Clojure: 200 Lines of Code, Minimalist Language Server Interaction

2025-05-11

This blog post details how the author implemented a minimal LSP client in under 200 lines of Clojure code and used it to build a command-line code linter. It walks through the implementation of the base communication layer, JSON-RPC layer, and client API for the LSP protocol. The author then discusses the challenges of using LSP in practice, particularly the reliance of most language servers on notifications instead of requests for diagnostics, making a simple command-line tool more complex than expected. Finally, the author summarizes the pros and cons of LSP and speculates on the future of WASM-based language servers.

Development