Add on_req_shutdown

This commit is contained in:
Christoph M. Wintersteiger 2024-07-22 16:28:56 +01:00 committed by Simon Cruanes
parent 267aa35650
commit 6785e46492

View file

@ -327,6 +327,11 @@ module Make (IO : IO) = struct
(** Provide inlay hints for this document.
@since 0.5 *)
method on_req_shutdown ~notify_back:(_ : notify_back) ~id:_ : unit IO.t =
IO.return ()
(** Process a shutdown request.
@since 0.7 *)
method on_request : type r.
notify_back:_ ->
server_request:_ ->
@ -342,8 +347,13 @@ module Make (IO : IO) = struct
match r with
| Lsp.Client_request.Shutdown ->
Log.info (fun k -> k "shutdown");
let notify_back =
new notify_back
~workDoneToken:None ~partialResultToken:None ~notify_back
~server_request ()
in
status <- `ReceivedShutdown;
IO.return ()
self#on_req_shutdown ~notify_back ~id
| Lsp.Client_request.Initialize i ->
Log.debug (fun k -> k "req: initialize");
let notify_back =