Skip to content

Commit ba2d067

Browse files
committed
fix compilation using Core
1 parent 36a9187 commit ba2d067

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

hh_json.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Caveats:
3535
(+) Numbers are just stored as strings
3636
*)
3737

38-
module List = Core_list
38+
module List = Core.List
3939

4040
type json =
4141
| JSON_Object of (string * json) list
@@ -787,4 +787,4 @@ end
787787

788788
module JSet = Set.Make (JsonKey)
789789

790-
module JMap = MyMap.Make (JsonKey)
790+
module JMap = Map.Make (JsonKey)

hh_json.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,4 @@ module JsonKey : Set.OrderedType with type t = json
191191

192192
module JSet : Set.S with type elt = json
193193

194-
module JMap : MyMap.S with type key = json
194+
module JMap : Map.S with type key = json

hh_json_helpers.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
**)
99

1010
open Hh_json
11+
module Option = Core.Option
12+
module Core_list = Core.List
1113

1214
(************************************************************************)
1315
(** Helpers for parsing & printing **)
@@ -117,7 +119,7 @@ module AdhocJsonHelpers = struct
117119

118120
let try_get_val key json =
119121
let obj = Hh_json.get_object_exn json in
120-
Core_list.Assoc.find obj key
122+
Core_list.Assoc.find obj key ~equal:String.equal
121123

122124
let get_string_val key ?default json =
123125
let v = try_get_val key json in

lsp.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
* entirely.
4141
*)
4242

43+
module SMap = Map.Make(String)
44+
4345
type lsp_id =
4446
| NumberId of int
4547
| StringId of string
@@ -1024,4 +1026,4 @@ module IdKey = struct
10241026
end
10251027

10261028
module IdSet = Set.Make (IdKey)
1027-
module IdMap = MyMap.Make (IdKey)
1029+
module IdMap = Map.Make (IdKey)

lsp_fmt.ml

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
*
88
*)
99

10-
open Hh_core
10+
(* open Hh_core *)
1111
open Lsp
1212
open Hh_json
1313
open Hh_json_helpers
14+
module List = Core.List
15+
module SMap = struct
16+
include Map.Make(String)
17+
let elements = bindings
18+
end
1419

1520

1621
(************************************************************************)
@@ -949,7 +954,7 @@ let error_of_exn (e: exn) : Lsp.Error.t =
949954
| Error.ServerNotInitialized message -> {code= -32002; message; data=None;}
950955
| Error.Unknown message -> {code= -32001; message; data=None;}
951956
| Error.RequestCancelled message -> {code= -32800; message; data=None;}
952-
| Exit_status.Exit_with code -> {code= -32001; message=Exit_status.to_string code; data=None;}
957+
(* | Exit_status.Exit_with code -> {code= -32001; message=Exit_status.to_string code; data=None;} *)
953958
| _ -> {code= -32001; message=Printexc.to_string e; data=None;}
954959

955960
let print_error (e: Error.t) (stack: string) : json =

0 commit comments

Comments
 (0)