lsp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package lsp implements a minimal Language Server Protocol server for sqldefkit, providing exactly two features: diagnostics (from the check engine) and go-to-definition. It hand-rolls JSON-RPC 2.0 framing over stdio (Content-Length headers) rather than depending on a third-party LSP library, since only a handful of message types are needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a running LSP server instance bound to a stdio-like transport.

func NewServer

func NewServer(in io.Reader, out io.Writer, errOut io.Writer) *Server

NewServer creates a Server that reads JSON-RPC messages from in and writes responses/notifications to out, logging diagnostics/errors to errOut.

func (*Server) Run

func (s *Server) Run() int

Run reads and dispatches messages until the stream ends or an "exit" notification is processed. It returns the process exit code the LSP spec mandates: 0 if "shutdown" was received before "exit" (or before the stream closed), 1 otherwise.

Jump to

Keyboard shortcuts

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