Language Server Protocol is an idea from Microsoft (brrr). This is the link for the current latest specification:

The basic idea is a RPC protocol, with an header, whose body is JSON-encoded:

Content-Length: ...\r\n
Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n
	"jsonrpc": "2.0",
	"id": 1,
	"method": "textDocument/didOpen",
	"params": {

The header is separated by CRLF (\r\n, as HTTP), and supports only these two fields:

Field name type
Content-Length number
Content-Type string
#The body

There are three main type of messages:

  • Request
  • Response
  • Notification

Every Request generates a Response, while a Notification is fire-and-forget (but may alter the execution flow of the client or the server).

#Existing implementations

There are many implementations. Two that are quite solid are:

These are full fledged LSP implementations, so to start studying it some simpler implementations might be more fit:


Random resources found on the web:

About this wiki

commit 7325f0ba0de6c331343c6909cb0da41f4c650353
Author: Blallo <blallo@autistici.org>
Date:   2022-05-03T00:37:05+02:00

Improve structure
Clone this wiki
https://git.sr.ht/~blallo/hare-lsp (read-only)
git@git.sr.ht:~blallo/hare-lsp (read/write)