class

LSP::Server

Inherits Reference < Object

A Language Server Protocol generic implementation.

This server is basically an I/O loop receiving, replying, sending message and handling exceptions. Actual actions are delegated to an external class.

Constants

DEFAULT_SERVER_CAPABILITIES = LSP::ServerCapabilities.new({ text_document_sync: LSP::TextDocumentSyncKind::Incremental, })

Dummy default server capabilites.

Constructors

new(input : IO = STDIN, output : IO = STDOUT, server_capabilities : LSP::ServerCapabilities = DEFAULT_SERVER_CAPABILITIES)

Initialize a new LSP Server with the provided options.

Source

Instance methods

client_capabilities

The lsp client capabilites.

Source
client_capabilities?

The lsp client capabilites.

Source
input

Input from which messages are received.

Source
output

Output to which the messages are sent.

Source
reply(request : LSP::RequestMessage, *, result : T, do_not_log = false) forall T

Reply to a request initiated by the client with the provided result.

Source
reply(request : LSP::RequestMessage, *, exception, do_not_log = false)

Reply to a request initiated by the client with an error message containing the exception details.

Source
requests_sent

A list of requests that were sent to clients to keep track of the ID and kind.

Source
send(message : LSP::Message, *, do_not_log = false)

Send a message to the client.

Source
send(messages : Array, *, do_not_log = false)

Send an array of messages to the client.

Source
server_capabilities

The broadcasted server capabilites.

Source
start(controller)
Source