Disable batch processing

Problem: There was a misunderstanding when implementing this: batch
processing should not return responses individually, but rather return a
list with batch responses. This will require some further logic to group
such responses in order to process them in sequence.

Solution: We return those methods to being unhandled.
This commit is contained in:
Heitor Toledo Lassarote de Paula 2023-03-14 15:27:32 -03:00
parent 5388f58530
commit 431f3ea126
No known key found for this signature in database
GPG key ID: BA315FF484143101

View file

@ -214,33 +214,17 @@ module Make (IO : IO) : S with module IO = IO = struct
let r = Lsp.Server_request.response_of_json req json in
with_error_handler self (fun () -> handler @@ Ok r))
let handle_batch_response (self : t) (rs : Jsonrpc.Response.t list) :
let handle_batch_response (_self : t) (_rs : Jsonrpc.Response.t list) :
unit IO.t =
let rec go = function
| [] -> IO.return ()
| r :: rs ->
let* () = handle_response self r in
go rs
in
go rs
IO.failwith "Unhandled: jsonrpc batch response"
let handle_batch_call (self : t)
(cs :
let handle_batch_call (_self : t)
(_cs :
[ `Notification of Jsonrpc.Notification.t
| `Request of Jsonrpc.Request.t
]
list) : unit IO.t =
let rec go = function
| [] -> IO.return ()
| c :: cs ->
let* () =
match c with
| `Notification n -> handle_notification self n
| `Request r -> handle_request self r
in
go cs
in
go cs
IO.failwith "Unhandled: jsonrpc batch call"
(* read a full message *)
let read_msg (self : t) : (Jsonrpc.Packet.t, exn) result IO.t =