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

@ -325,7 +325,12 @@ module Make (IO : IO) = struct
: Lsp.Types.InlayHint.t list option IO.t = : Lsp.Types.InlayHint.t list option IO.t =
IO.return None IO.return None
(** Provide inlay hints for this document. (** Provide inlay hints for this document.
@since 0.5 *) @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. method on_request : type r.
notify_back:_ -> notify_back:_ ->
@ -342,8 +347,13 @@ module Make (IO : IO) = struct
match r with match r with
| Lsp.Client_request.Shutdown -> | Lsp.Client_request.Shutdown ->
Log.info (fun k -> k "shutdown"); Log.info (fun k -> k "shutdown");
let notify_back =
new notify_back
~workDoneToken:None ~partialResultToken:None ~notify_back
~server_request ()
in
status <- `ReceivedShutdown; status <- `ReceivedShutdown;
IO.return () self#on_req_shutdown ~notify_back ~id
| Lsp.Client_request.Initialize i -> | Lsp.Client_request.Initialize i ->
Log.debug (fun k -> k "req: initialize"); Log.debug (fun k -> k "req: initialize");
let notify_back = let notify_back =