Skip to content

Commit c92d1e4

Browse files
ggreiftrefis
authored andcommitted
handle yojson deprecation warnings (#1027)
1 parent 8c25431 commit c92d1e4

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Manually building and installing Merlin
2424
Compilation
2525
-----------
2626

27-
Dependencies: ocaml >= 4.02.3, ocamlfind, yojson, dune >= 1.8.
27+
Dependencies: ocaml >= 4.02.3, ocamlfind, yojson >= 1.6.0, dune >= 1.8.
2828

2929
```shell
3030
dune build -p merlin
@@ -111,7 +111,7 @@ Read more in the [wiki](https://github.com/ocaml/merlin/wiki) to learn how to ma
111111

112112
Development of Merlin
113113
=====================
114-
114+
115115
Most of the development happens through the [github page](https://github.com/ocaml/merlin).
116116

117117
The [mailing list](https://lists.forge.ocamlcore.org/cgi-bin/listinfo/merlin-discuss) welcomes general questions and discussions.

appveyor.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ case $MODE in
7575
appveyor DownloadFile "http://download.camlcity.org/download/findlib-1.7.3.tar.gz" -FileName findlib-1.7.3.tar.gz
7676
appveyor DownloadFile "https://github.com/ocaml/dune/releases/download/1.0.1/dune-1.0.1.tbz" -FileName dune-1.0.1.tbz
7777
appveyor DownloadFile "https://github.com/ocaml/ocamlbuild/archive/0.11.0.tar.gz" -FileName ocamlbuild-0.11.0.tar.gz
78-
appveyor DownloadFile "https://github.com/mjambon/yojson/archive/v1.4.0.tar.gz" -FileName yojson-1.4.0.tar.gz
78+
appveyor DownloadFile "https://github.com/ocaml-community/yojson/archive/v1.6.0.tar.gz" -FileName yojson-1.6.0.tar.gz
7979
cp $APPVEYOR_BUILD_FOLDER/appveyor/*.patch $APPVEYOR_BUILD_FOLDER/../src/
8080
[[ -e $PREFIX/../version ]] || echo $OCAML_VERSION-$SERIAL> $PREFIX/../version
8181
fi
@@ -145,7 +145,7 @@ case $MODE in
145145
cd ..
146146
fi
147147
tar -xzf $APPVEYOR_BUILD_FOLDER/../src/cppo-1.5.0.tar.gz
148-
tar -xzf $APPVEYOR_BUILD_FOLDER/../src/yojson-1.4.0.tar.gz
148+
tar -xzf $APPVEYOR_BUILD_FOLDER/../src/yojson-1.6.0.tar.gz
149149
cd ocaml
150150

151151
LOG_FILE=OCaml-$OCAML_VERSION-$PORT.log
@@ -179,7 +179,7 @@ case $MODE in
179179
fi
180180
cd ../cppo-1.5.0
181181
quietly_log "make PREFIX=$PREFIX opt install-bin"
182-
cd ../yojson-1.4.0
182+
cd ../yojson-1.6.0
183183
quietly_log "make && ocamlfind install yojson _build/install/default/lib/yojson/*"
184184
# Remove unnecessary commands to keep the build cache size down
185185
rm $PREFIX/bin/{ocaml,ocamlcp,ocamldebug,ocamldoc,ocamlmktop,ocamlobjinfo,ocamloptp,ocamlprof}.exe $PREFIX/lib/{expunge,extract_crc,objinfo_helper}.exe

merlin-lsp.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ depends: [
1515
"ocaml" {>= "4.04.0"}
1616
"dune" {build & >= "1.8.0"}
1717
"ocamlfind" {>= "1.5.2"}
18-
"yojson"
19-
"ppx_deriving_yojson"
18+
"yojson" {>= "1.6.0"}
19+
"ppx_deriving_yojson" {>= "3.4"}
2020
"mdx" {with-test & >= "1.3.0"}
2121
]
2222
synopsis:

merlin.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ depends: [
1414
"ocaml" {>= "4.02.1" & < "4.09"}
1515
"dune" {>= "1.8.0"}
1616
"ocamlfind" {>= "1.5.2"}
17-
"yojson"
17+
"yojson" {>= "1.6.0"}
1818
"mdx" {with-test & >= "1.3.0"}
1919
]
2020
synopsis:

src/frontend/old/old_IO.mli

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ val current_version : Old_protocol.protocol_version ref
3434
(* Misc *)
3535
val default_context : Old_protocol.Context.t
3636

37-
val request_of_json : json -> Old_protocol.request
37+
val request_of_json : Json.t -> Old_protocol.request
3838
val json_of_response : Logger.notification list ->
39-
Old_protocol.response -> json
39+
Old_protocol.response -> Json.t
4040

4141
val make_json : ?on_read:(Unix.file_descr -> unit) ->
4242
input:Unix.file_descr ->
4343
output:Unix.file_descr ->
44-
unit -> (unit -> json option) * (json -> unit)
44+
unit -> (unit -> Json.t option) * (Json.t -> unit)
4545

4646
val make_sexp : ?on_read:(Unix.file_descr -> unit) ->
4747
input:Unix.file_descr ->
4848
output:Unix.file_descr ->
49-
unit -> (unit -> json option) * (json -> unit)
49+
unit -> (unit -> Json.t option) * (Json.t -> unit)

src/frontend/old/old_protocol.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,5 @@ type request = Request : Context.t * 'a command -> request
9494
type response =
9595
| Return : 'a command * 'a -> response
9696
| Failure : string -> response
97-
| Error : json -> response
97+
| Error : Json.t -> response
9898
| Exception : exn -> response

src/lsp/rpc.ml

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module Packet = struct
7979
type t = {
8080
id: int option [@default None];
8181
method_: string [@key "method"];
82-
params: Yojson.Safe.json;
82+
params: Yojson.Safe.t;
8383
} [@@deriving yojson { strict = false }]
8484
end
8585

@@ -120,7 +120,7 @@ module Response = struct
120120
type response = {
121121
id : int;
122122
jsonrpc: string;
123-
result : Yojson.Safe.json;
123+
result : Yojson.Safe.t;
124124
} [@@deriving yojson]
125125

126126
type response_error = {
@@ -154,7 +154,7 @@ let send_response rpc (response : Response.t) =
154154
send rpc json
155155

156156
module Server_notification = struct
157-
open Protocol
157+
open Protocol
158158

159159
type t =
160160
| PublishDiagnostics of PublishDiagnostics.params
@@ -181,7 +181,7 @@ module Client_notification = struct
181181
| TextDocumentDidChange of DidChange.params
182182
| Initialized
183183
| Exit
184-
| UnknownNotification of string * Yojson.Safe.json
184+
| UnknownNotification of string * Yojson.Safe.t
185185
end
186186

187187
module Request = struct
@@ -200,7 +200,7 @@ module Request = struct
200200
| DebugTextDocumentGet : DebugTextDocumentGet.params -> DebugTextDocumentGet.result t
201201
| TextDocumentReferences : References.params -> References.result t
202202
| TextDocumentHighlight : TextDocumentHighlight.params -> TextDocumentHighlight.result t
203-
| UnknownRequest : string * Yojson.Safe.json -> unit t
203+
| UnknownRequest : string * Yojson.Safe.t -> unit t
204204

205205
let request_result_to_response (type a) id (req : a t) (result : a) =
206206
match req, result with

src/lsp/rpc.mli

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module Server_notification : sig
66
open Protocol
77

8-
type t =
8+
type t =
99
| PublishDiagnostics of PublishDiagnostics.publishDiagnosticsParams
1010
end
1111

@@ -17,7 +17,7 @@ module Client_notification : sig
1717
| TextDocumentDidChange of DidChange.params
1818
| Initialized
1919
| Exit
20-
| UnknownNotification of string * Yojson.Safe.json
20+
| UnknownNotification of string * Yojson.Safe.t
2121
end
2222

2323
module Request : sig
@@ -36,7 +36,7 @@ module Request : sig
3636
| DebugTextDocumentGet : DebugTextDocumentGet.params -> DebugTextDocumentGet.result t
3737
| TextDocumentReferences : References.params -> References.result t
3838
| TextDocumentHighlight : TextDocumentHighlight.params -> TextDocumentHighlight.result t
39-
| UnknownRequest : string * Yojson.Safe.json -> unit t
39+
| UnknownRequest : string * Yojson.Safe.t -> unit t
4040
end
4141

4242
type t

src/lsp/uri.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type t
22

3-
val of_yojson : Yojson.Safe.json -> (t, string) result
4-
val to_yojson : t -> Yojson.Safe.json
3+
val of_yojson : Yojson.Safe.t -> (t, string) result
4+
val to_yojson : t -> Yojson.Safe.t
55

66
val to_path : t -> string
77
val of_path : string -> t

0 commit comments

Comments
 (0)