package linol

  1. Overview
  2. Docs

Server interface for some IO substrate.

Parameters

module IO : sig ... end

Signature

module Position = Lsp.Types.Position
module Range = Lsp.Types.Range
module Diagnostic = Lsp.Types.Diagnostic
module DiagnosticSeverity = Lsp.Types.DiagnosticSeverity
module Req_id = Req_id
type server_request_handler_pair =
  1. | Request_and_handler : 'from_server Lsp.Server_request.t * (('from_server, Jsonrpc.Response.Error.t) Stdlib.result -> unit IO.t) -> server_request_handler_pair

A variant carrying a Lsp.Server_request.t and a handler for its return value. The request is stored in order to allow us to discriminate its existential variable.

The type of the action that sends a request from the server to the client and handles its response.

class virtual base_server : object ... end

The server baseclass

val async : base_server -> (unit -> unit IO.t) -> unit IO.t
class notify_back : notify_back:(Lsp.Server_notification.t -> unit IO.t) -> server_request:(server_request_handler_pair -> Req_id.t IO.t) -> workDoneToken:[ `Int of int | `String of string ] option -> partialResultToken:'a -> ?version: int option -> ?uri:Lsp.Types.DocumentUri.t option -> unit -> object ... end

A wrapper to more easily reply to notifications

type nonrec doc_state = doc_state = {
  1. uri : Lsp.Types.DocumentUri.t;
  2. languageId : string;
  3. version : int;
  4. content : string;
}

Current state of a document.

class virtual server : object ... end

An easily overloadable class. Pick the methods you want to support. The user must provide at least the callbacks for document lifecycle: open, close, update. The most basic LSP server should check documents when they're updated and report diagnostics back to the editor.

OCaml

Innovation. Community. Security.