lsp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package lsp is m-cli's Language Server (spec §3.1): LSP 3.x over stdio, reusing the lint and fmt engines so the editor shows exactly the diagnostics CI produces. JSON-RPC framing is hand-rolled on the stdlib to keep the SBOM minimal (no LSP-library dependency). This first increment wires the foundation — lifecycle, full text sync, push diagnostics, and formatting; hover/completion/definition/symbols/code-actions layer on later.

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 stdio LSP server. It owns one parser, a document store, and a cache of linters keyed by the project config governing each document — so a file's diagnostics use the SAME resolved rule set `m lint`/pre-commit would (G2). The message loop is single-threaded, so the parser is never used concurrently. Build with New, run with Serve, release with Close.

func New

func New(in io.Reader, out io.Writer) (*Server, error)

New builds a server reading framed messages from in and writing to out.

func (*Server) Close

func (s *Server) Close()

Close releases every cached linter and the parser.

func (*Server) Serve

func (s *Server) Serve() error

Serve runs the message loop until `exit` (or EOF).

Jump to

Keyboard shortcuts

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