package linol

  1. Overview
  2. Docs

Module Jsonrpc2.MakeSource

Parameters

module IO : IO

Signature

Sourcemodule IO = IO
Sourcetype t

A jsonrpc2 connection.

include sig ... end
Sourcemodule Position = Lsp.Types.Position
Sourcemodule Range = Lsp.Types.Range
Sourcemodule Diagnostic = Lsp.Types.Diagnostic
Sourcemodule DiagnosticSeverity = Lsp.Types.DiagnosticSeverity
Sourcemodule Req_id : sig ... end

Request ID.

Sourcetype server_request_handler_pair =
  1. | Request_and_handler : 'from_server Lsp.Server_request.t * (('from_server, Jsonrpc.Response.Error.t) result -> unit IO.t) -> server_request_handler_pair
Sourceclass virtual base_server : object ... end
Sourceval async : base_server -> (unit -> unit IO.t) -> unit IO.t
Sourceclass 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 -> ?uri:Lsp.Types.DocumentUri.t -> unit -> object ... end
Sourcetype nonrec doc_state = {
  1. uri : Lsp.Types.DocumentUri.t;
  2. languageId : string;
  3. version : int;
  4. content : string;
}
Sourceval lift_ok : 'a IO.t -> ('a, 'b) result IO.t
Sourceclass virtual server : object ... end
Sourceval create : ?on_received:(json -> unit) -> ?on_sent:(json -> unit) -> ic:IO.in_channel -> oc:IO.out_channel -> server -> t

Create a connection from the pair of channels

Sourceval create_stdio : ?on_received:(json -> unit) -> ?on_sent:(json -> unit) -> env:IO.env -> server -> t

Create a connection using stdin/stdout

Sourceval send_server_notification : t -> Lsp.Server_notification.t -> unit IO.t

Send a notification from the server.

  • since 0.5
Sourceval send_server_request : t -> 'from_server Lsp.Server_request.t -> (('from_server, Jsonrpc.Response.Error.t) result -> unit IO.t) -> Req_id.t IO.t

Send a request from the server, and pass a callback that will be called with the result in the future.

  • since 0.5
Sourceval run : ?shutdown:(unit -> bool) -> t -> unit IO.t

Listen for incoming messages and responses.

  • parameter shutdown

    if true, tells the server to shut down

OCaml

Innovation. Community. Security.