class LSP::Server
- LSP::Server
- Reference
- Object
Overview
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.
Defined in:
server.crConstant Summary
-
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.
Instance Method Summary
-
#client_capabilities : LSP::ClientCapabilities
The lsp client capabilites.
-
#client_capabilities? : LSP::ClientCapabilities?
The lsp client capabilites.
-
#input : IO
Input from which messages are received.
-
#output : IO
Output to which the messages are sent.
-
#reply(request : LSP::RequestMessage, *, result : T, do_not_log = false) forall T
Reply to a request initiated by the client with the provided result.
-
#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.
-
#requests_sent : Hash(RequestMessage::RequestId, LSP::Message)
A list of requests that were sent to clients to keep track of the ID and kind.
-
#send(message : LSP::Message, *, do_not_log = false)
Send a message to the client.
-
#send(messages : Array, *, do_not_log = false)
Send an array of messages to the client.
-
#server_capabilities : LSP::ServerCapabilities
The broadcasted server capabilites.
- #start(controller)
-
#thread : Thread
This server thread, that should not get blocked by all means.
Constructor Detail
Initialize a new LSP Server with the provided options.
Instance Method Detail
Reply to a request initiated by the client with the provided result.
Reply to a request initiated by the client with an error message containing the exception details.
A list of requests that were sent to clients to keep track of the ID and kind.