Skip to content

Commit

Permalink
handle yojson deprecation warnings (ocaml#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif authored and trefis committed Oct 9, 2019
1 parent f06c45c commit 3952841
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions lsp/src/lsp/rpc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lsp/src/lsp/rpc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Server_notification : sig
open Protocol

type t =
type t =
| PublishDiagnostics of PublishDiagnostics.publishDiagnosticsParams
end

Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lsp/src/lsp/uri.mli
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3952841

Please sign in to comment.