XRAPH/Work/LSP adapter
Go · since 2026

langserver

A language-agnostic adapter for building language servers in Go. It handles JSON-RPC framing, sessions and LSP position mapping, and knows nothing about any particular language. The core packages are standard-library only, enforced by a test.

Language
Go
Category
LSP adapter
Since
2026
Stars
0
Repository Docs
01

Highlights

3 claims
H.01
Zerodeps
In the core packages

Framing, sessions and positions are standard library only, so an LSP binary does not inherit a WebSocket stack. A test enforces it.

H.02
UTF-16
Positions done correctly

LSP counts characters in code units and Go counts bytes. Counting runes is as wrong as counting bytes, it just fails later.

H.03
Twobindings
stdio and WebSocket

How an editor launches a server, and how a browser reaches one, behind the same handler map.

02

What it handles

5 entries
Protocol adapter

The parts every language server repeats. You supply the functions and it supplies the protocol.

02.1
Transport

JSON-RPC framing and dispatch

Content-Length framing, request and notification handling, and a handler map keyed by method name. A language module registers the methods it answers and ignores the rest.

No dependencies
02.2
Sessions

Document state per connection

Open documents, their versions and their content are held per session, so a handler is given the text it is being asked about instead of reading from disk and hoping.

Versioned
02.3
Positions

UTF-16 code units, not bytes

Offset and position conversion that is correct for accented characters, CJK and emoji. A rune above the Basic Multilingual Plane is one rune, up to four bytes and two code units, and counting either of the wrong two produces an off-by-some that only appears in somebody else’s language.

Clamping
Positions
02.4
Bindings

stdio and WebSocket

stdio is how editors launch a server. WebSocket is how a browser reaches one. They are separate packages so the dependency the second needs is not paid for by the first.

Separate packages
02.5
Boundary

It knows no languages

Nothing in the adapter is aware of a grammar, a type system or a symbol table. DQL uses it to ship an editor experience, and so could anything else with functions to call.

Language-agnostic
The package reference
03

Anatomy

4 modules
01

langserver

JSON-RPC framing, sessions and handler dispatch. No dependencies.

02

lsp

Positions and ranges, including the UTF-16 arithmetic. No dependencies.

03

stdio

The binding editors use to launch a server. No dependencies.

04

ws

The WebSocket binding, and the only package that costs a dependency.

04

Why it exists

Design notes

A language-agnostic adapter for building language servers in Go. It handles JSON-RPC framing, sessions and LSP position mapping, and knows nothing about any particular language. The core packages are standard-library only, enforced by a test.

05

Signals

GitHub
Stars
0
Language
Go
Since
2026
Adopters
00

Shipping something on langserver? Nobody is listed here yet. Tell me what you built and you will be the first.

Get listed
06

Where it sits

Fields · papers