Add a comment to send_server_req

Problem: There is an invariant that must be satisfied to call that
function.

Solution: Describe it to warn users of jsonrpc2.
This commit is contained in:
Heitor Toledo Lassarote de Paula 2023-03-15 12:02:02 -03:00
parent 431f3ea126
commit 8857d5e7c5
No known key found for this signature in database
GPG key ID: BA315FF484143101

View file

@ -86,6 +86,10 @@ module Make (IO : IO) : S with module IO = IO = struct
let json = Jsonrpc.Notification.yojson_of_t m in
send_json_ self json
(** Send a server request to the LSP client. Invariant: you should call
[register_server_request_response_handler] before calling this method to
ensure that [handle_response] will have a registered handler for this
response. *)
let send_server_req (self : t) (m : Jsonrpc.Request.t) : unit IO.t =
let json = Jsonrpc.Request.yojson_of_t m in
send_json_ self json