lsp

module
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT

README

toba/lsp

Shared Go packages for building LSP servers — the plumbing you'd rather not rewrite every time you start a new language server.

Extracted from sqlite-lsp once it became clear that the infrastructure bits were going to get copied verbatim into the next project (and the one after that).

Packages

  • logging — Structured JSON logging with file rotation. Writes to {UserCacheDir}/{appName}/{appName}.log, rotates at 5 MB, falls back to stderr if things go sideways.
  • pathutil — Converts between file:// URIs and OS file paths. Handles the Windows drive-letter dance so you don't have to.
  • position — Byte offset to line/column conversion and back. The kind of thing that's trivial until you get it wrong and every diagnostic points at the wrong line.
  • transport — LSP message framing over stdin/stdout. Reads and writes Content-Length: N\r\n\r\n{json} — the protocol's one concession to HTTP that nobody asked for.

Install

go get github.com/toba/lsp

License

MIT

Directories

Path Synopsis
Package logging provides structured logging setup for LSP servers.
Package logging provides structured logging setup for LSP servers.
Package pathutil converts between LSP file URIs and OS file paths.
Package pathutil converts between LSP file URIs and OS file paths.
Package position converts between byte offsets and line/column positions.
Package position converts between byte offsets and line/column positions.
Package server provides a reusable LSP server harness built on go.lsp.dev/protocol and go.lsp.dev/jsonrpc2.
Package server provides a reusable LSP server harness built on go.lsp.dev/protocol and go.lsp.dev/jsonrpc2.
Package transport implements LSP message framing over stdin/stdout.
Package transport implements LSP message framing over stdin/stdout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL