package
0.0.0-20211013214444-3022da0884b2
Repository: https://github.com/jdbaldry/go-language-server-protocol.git
Documentation: pkg.go.dev

# Packages

Package servertest provides utilities for running tests against a remote LSP server.

# Functions

AsyncHandler returns a handler that processes each request goes in its own goroutine.
CancelHandler returns a handler that supports cancellation, and a function that can be used to trigger canceling in progress requests.
No description provided by the author
HandlerServer returns a StreamServer that handles incoming streams using the provided handler.
ListenAndServe starts an jsonrpc2 server on the given address.
MethodNotFound is a Handler that replies to all call requests with the standard method not found response.
MustReplyHandler creates a Handler that panics if the wrapped handler does not call Reply for every request that it is passed.
NewCall constructs a new Call message for the supplied ID, method and parameters.
NewConn creates a new connection object around the supplied stream.
No description provided by the author
NewHeaderStream returns a Stream built on top of a net.Conn.
NewIntID returns a new numerical request ID.
NewNotification constructs a new Notification message for the supplied method and parameters.
NewRawStream returns a Stream built on top of a net.Conn.
NewResponse constructs a new Response message that is a reply to the supplied.
NewStringID returns a new string request ID.
Serve accepts incoming connections from the network, and handles them using the provided server.

# Constants

ErrIdleTimeout is returned when serving timed out waiting for new connections.

# Variables

ErrInternal is not currently returned but defined for completeness.
ErrInvalidParams should be returned by the handler when method parameter(s) were invalid.
ErrInvalidRequest is used when the JSON sent is not a valid Request object.
ErrMethodNotFound should be returned by the handler when the method does not exist / is not available.
ErrParse is used when invalid JSON was received by the server.
ErrServerOverloaded is returned when a message was refused due to aserver being temporarily unable to accept any new messages.
ErrUnknown should be used for all non coded errors.

# Structs

Call is a request that expects a response.
ID is a Request identifier.
Notification is a request for which a response cannot occur, and as such it has not ID.
Response is a reply to a Call.

# Interfaces

Conn is the common interface to jsonrpc clients and servers.
Message is the interface to all jsonrpc2 message types.
Request is the shared interface to jsonrpc2 messages that request a method be invoked.
Stream abstracts the transport mechanics from the JSON RPC protocol.
A StreamServer is used to serve incoming jsonrpc2 clients communicating over a newly created connection.

# Type aliases

Framer wraps a network connection up into a Stream.
Handler is invoked to handle incoming requests.
Replier is passed to handlers to allow them to reply to the request.
The ServerFunc type is an adapter that implements the StreamServer interface using an ordinary function.