diff --git a/lsp/src/lsp/rpc.ml b/lsp/src/lsp/rpc.ml index 406250325..4c29e6c99 100644 --- a/lsp/src/lsp/rpc.ml +++ b/lsp/src/lsp/rpc.ml @@ -79,7 +79,7 @@ module Packet = struct type t = { id: int option [@default None]; method_: string [@key "method"]; - params: Yojson.Safe.json; + params: Yojson.Safe.t; } [@@deriving yojson { strict = false }] end @@ -120,7 +120,7 @@ module Response = struct type response = { id : int; jsonrpc: string; - result : Yojson.Safe.json; + result : Yojson.Safe.t; } [@@deriving yojson] type response_error = { @@ -154,7 +154,7 @@ let send_response rpc (response : Response.t) = send rpc json module Server_notification = struct - open Protocol + open Protocol type t = | PublishDiagnostics of PublishDiagnostics.params @@ -181,7 +181,7 @@ module Client_notification = struct | TextDocumentDidChange of DidChange.params | Initialized | Exit - | UnknownNotification of string * Yojson.Safe.json + | UnknownNotification of string * Yojson.Safe.t end module Request = struct @@ -200,7 +200,7 @@ module Request = struct | DebugTextDocumentGet : DebugTextDocumentGet.params -> DebugTextDocumentGet.result t | TextDocumentReferences : References.params -> References.result t | TextDocumentHighlight : TextDocumentHighlight.params -> TextDocumentHighlight.result t - | UnknownRequest : string * Yojson.Safe.json -> unit t + | UnknownRequest : string * Yojson.Safe.t -> unit t let request_result_to_response (type a) id (req : a t) (result : a) = match req, result with diff --git a/lsp/src/lsp/rpc.mli b/lsp/src/lsp/rpc.mli index ea134657a..8021e2ae5 100644 --- a/lsp/src/lsp/rpc.mli +++ b/lsp/src/lsp/rpc.mli @@ -5,7 +5,7 @@ module Server_notification : sig open Protocol - type t = + type t = | PublishDiagnostics of PublishDiagnostics.publishDiagnosticsParams end @@ -17,7 +17,7 @@ module Client_notification : sig | TextDocumentDidChange of DidChange.params | Initialized | Exit - | UnknownNotification of string * Yojson.Safe.json + | UnknownNotification of string * Yojson.Safe.t end module Request : sig @@ -36,7 +36,7 @@ module Request : sig | DebugTextDocumentGet : DebugTextDocumentGet.params -> DebugTextDocumentGet.result t | TextDocumentReferences : References.params -> References.result t | TextDocumentHighlight : TextDocumentHighlight.params -> TextDocumentHighlight.result t - | UnknownRequest : string * Yojson.Safe.json -> unit t + | UnknownRequest : string * Yojson.Safe.t -> unit t end type t diff --git a/lsp/src/lsp/uri.mli b/lsp/src/lsp/uri.mli index b27e0da08..1a6272611 100644 --- a/lsp/src/lsp/uri.mli +++ b/lsp/src/lsp/uri.mli @@ -1,7 +1,7 @@ type t -val of_yojson : Yojson.Safe.json -> (t, string) result -val to_yojson : t -> Yojson.Safe.json +val of_yojson : Yojson.Safe.t -> (t, string) result +val to_yojson : t -> Yojson.Safe.t val to_path : t -> string val of_path : string -> t