langserver

package
v0.2.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package langserver implements the language server endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConcurrency

func DefaultConcurrency() int

Types

type CallRequest

type CallRequest struct {
	Method    string
	ReqParams string
}

type LangServer

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

func New

func New(srvCtx context.Context, opts Options) *LangServer

func (*LangServer) StartAndWait

func (ls *LangServer) StartAndWait(reader io.Reader, writer io.WriteCloser) error

func (*LangServer) StartTCP

func (ls *LangServer) StartTCP(address string) error

type Mock

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

func NewMock

func NewMock(t T, opts Options) *Mock

func (*Mock) Call

func (lsm *Mock) Call(t T, cr *CallRequest) *rawResponse

func (*Mock) CallAndExpectError

func (lsm *Mock) CallAndExpectError(t *testing.T, cr *CallRequest, expectErr error)

func (*Mock) CallAndExpectResponse

func (lsm *Mock) CallAndExpectResponse(t *testing.T, cr *CallRequest, expectRaw string)

func (*Mock) CloseClientStdout

func (lsm *Mock) CloseClientStdout(t T)

func (*Mock) Notify

func (lsm *Mock) Notify(t *testing.T, cr *CallRequest)

func (*Mock) Start

func (lsm *Mock) Start(t T) context.CancelFunc

Start is more or less duplicate of LangServer.StartAndWait except that this one doesn't wait

TODO: Explore whether we could leverage jrpc2's server.Local

func (*Mock) Stop

func (lsm *Mock) Stop()

func (*Mock) StopFuncCalled

func (lsm *Mock) StopFuncCalled() bool

type Options

type Options struct {
	ServerVersion string
	Concurrency   int
	Factory       session.Factory
}

type T

type T interface {
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
}

Directories

Path Synopsis
Package handlers provides the core handler implementation that is responsible for managing internal features, and dispatching requests to these.
Package handlers provides the core handler implementation that is responsible for managing internal features, and dispatching requests to these.
Package lsp provides functions to convert generic interfaces to LSP-specific types.
Package lsp provides functions to convert generic interfaces to LSP-specific types.
Package protocol provides generated types for use in the language server implementation.
Package protocol provides generated types for use in the language server implementation.
Package session provides session lifecycle tracking for a language server.
Package session provides session lifecycle tracking for a language server.

Jump to

Keyboard shortcuts

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