Get the latest tech news

LSP: The good, the bad, and the ugly


For a few years now I have been working on the Haskell Language Server (HLS), and the lsp library for the LSP protocol and writing LSP servers. Unsurprisingly, I have developed some opinions about the design of the LSP! Recently I gave a talk about HLS and LSP at the Haskell Ecosystem Workshop at Zurihac 2024. One slide featured a hastily-written table of “LSP: the good, the bad, and the ugly”. As I gave the talk I realised that there was plenty to say on that topic, hence this post. Most of what I have to say is about the architecture or design of the protocol. I won’t have much to say about the features that the protocol supports. Other people probably have a lot to say about that (e.g the folks working on languages that use heavy editor integration, like interactive theorem provers). My perspective here is from my time implementing LSP servers, rather than my time using them. I will repeat this a few times, but I want to be very clear that LSP is great and I am very happy that it exists. While this is going to be a mostly critical post, it is criticism that exists in the context of me being happy to be working on editor tooling that is going to Just Work for a wide spectrum of users! Finally, I want to also mention the excellent post LSP could have been better, which is the best critical writing that I’ve read on LSP, and which inspired several of the points I’m going to make.

Another consequence of the lack of openness is that there is no forum for agreeing on extensions to the somewhat arbitrary enumerations that the LSP specification has for things like symbol types. Unsurprisingly, the two features that support incremental updates are the ones that involve transferring lots of data: text document contents and semantic tokens. While I’m not an expert and I wouldn’t want to have to draft such a thing myself, state synchronization is a well-studied problem in the academic literature, so we should be able to benefit from a lot of prior art.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of good

good

Photo of LSP

LSP

Related news:

News photo

Beyond Good and Evil's 20th Anniversary Edition: a near perfect way to revisit a classic

News photo

The good, the bad, and the weird (2018)

News photo

Silicon Valley leaders are once again declaring ‘DEI’ bad and ‘meritocracy’ good — but they’re wrong