Get the latest tech news

LSP client in Clojure in 200 lines of code


I wrote a small LSP client, it was kinda neat so I’m sharing it

So let’s just say I kept things simple for illustrative purposes, and spawning one more virtual thread to compute and send a response to the server is left as an exercise for the reader :D We issue a blocking initialize call, and tell the server our process id (so it can exit if we die before stopping it), which directory is the project root, and what are our capabilities. Defold LSP support is much more complex than our toy implementation because a text editor needs to manage the whole zoo of language servers, each with it’s own lifecycle, initialization process and capabilities.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Code

Code

Photo of lines

lines

Photo of Clojure

Clojure

Related news:

News photo

ChatGPT’s deep research tool gets a GitHub connector to answer questions about code

News photo

Docs like code in basic terms

News photo

Ox Security lands a fresh $60M to scan for vulnerabilities in code