lsp

package
v0.3.42 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package lsp adapts the shared compiler and language services to the Language Server Protocol. Protocol transport remains separate from project discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Mode             string
	Version          string
	Units            []compiler.SourceUnit
	CompilerOptions  compiler.Options
	ExcludedRoots    []string
	IncludedFiles    []string
	ResolveUnit      UnitResolver
	ResolveWorkspace WorkspaceResolver
	// BackgroundDiagnostics keeps full-project analysis off the JSON-RPC
	// request path. Interactive editor transports should enable it; direct
	// adapters and focused tests may keep synchronous diagnostics.
	BackgroundDiagnostics bool
	Input                 io.Reader
	Output                io.Writer
}

type Server

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

func New

func New(options Options) *Server

func (*Server) Run

func (s *Server) Run() error

type UnitResolver

type UnitResolver func(filename string, source []byte) (compiler.SourceUnit, error)

type WorkspaceResolver added in v0.2.29

type WorkspaceResolver func(overlays map[string][]byte) ([]compiler.SourceUnit, error)

WorkspaceResolver rebuilds a complete workspace snapshot. Open document contents are keyed by clean absolute filenames and take precedence over filesystem contents when the adapter loads the snapshot.

Jump to

Keyboard shortcuts

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