lsp

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package lsp implements a Language Server Protocol server for ELPS. It provides diagnostics, hover, go-to-definition, references, completion, document symbols, and rename support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	URI     string
	Version int32
	Content string
	// contains filtered or unexported fields
}

Document represents an open text document tracked by the LSP server.

type DocumentStore

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

DocumentStore manages open documents with thread-safe access.

func NewDocumentStore

func NewDocumentStore() *DocumentStore

NewDocumentStore creates an empty document store.

func (*DocumentStore) Change

func (s *DocumentStore) Change(uri string, version int32, content string) *Document

Change updates a document's content (full sync) and re-parses it.

func (*DocumentStore) Close

func (s *DocumentStore) Close(uri string)

Close removes a document from the store.

func (*DocumentStore) Get

func (s *DocumentStore) Get(uri string) *Document

Get retrieves a document by URI. Returns nil if not found.

func (*DocumentStore) Open

func (s *DocumentStore) Open(uri string, version int32, content string) *Document

Open adds a document to the store and parses it.

type Option

type Option func(*Server)

Option configures the LSP server.

func WithEnv

func WithEnv(env *lisp.LEnv) Option

WithEnv injects a fully initialized ELPS environment.

func WithRegistry

func WithRegistry(reg *lisp.PackageRegistry) Option

WithRegistry injects an embedder's package registry for stdlib exports.

type Server

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

Server is the ELPS language server.

func New

func New(opts ...Option) *Server

New creates a new ELPS LSP server.

func (*Server) RunStdio

func (s *Server) RunStdio() error

RunStdio starts the server using stdio transport.

func (*Server) RunTCP

func (s *Server) RunTCP(addr string) error

RunTCP starts the server listening on the given address.

Jump to

Keyboard shortcuts

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