Skip to content

Commit d72f054

Browse files
committed
Update to latest stdune
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
1 parent 400e9b6 commit d72f054

File tree

172 files changed

+1629
-623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+1629
-623
lines changed

fiber-test/fiber_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ open Stdune
22

33
let printf = Printf.printf
44

5-
let print pp = Format.printf "%a@." Pp.render_ignore_tags pp
5+
let print pp = Format.printf "%a@." Pp.to_fmt pp
66

77
let print_dyn dyn = print (Dyn.pp dyn)
88

lsp/bin/ocaml/ocaml.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module Json = struct
189189
)
190190

191191
let is_json_constr (constr : Ml.Type.constr) =
192-
List.mem constr.name ~set:[ "String"; "Int"; "Bool" ]
192+
List.mem [ "String"; "Int"; "Bool" ] constr.name ~equal:String.equal
193193

194194
module Name = struct
195195
let of_ = sprintf "%s_of_yojson"
@@ -261,7 +261,7 @@ end
261261

262262
let pp_file pp ch =
263263
let fmt = Format.formatter_of_out_channel ch in
264-
Pp.render_ignore_tags fmt pp;
264+
Pp.to_fmt fmt pp;
265265
Format.pp_print_flush fmt ()
266266

267267
module Create = struct
@@ -531,7 +531,8 @@ module Mapper = struct
531531
[ Prim.Null; String; Bool; Number; Object; List ]
532532
|> List.map ~f:(fun s -> Resolved.Ident s)
533533
in
534-
fun set -> List.for_all constrs ~f:(List.mem ~set)
534+
fun set ->
535+
List.for_all constrs ~f:(fun e -> List.mem set e ~equal:Poly.equal)
535536

536537
let id = Type.name "Jsonrpc.Id.t"
537538

ocaml-lsp-server/src/import.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Table = Stdune.Table
99
module String = Stdune.String
1010
module List = Stdune.List
1111
module Result = Stdune.Result
12+
module Poly = Stdune.Poly
1213
module Logger = Lsp.Logger
1314
module Loc = Location
1415
module Scheduler = Fiber_unix.Scheduler

ocaml-lsp-server/src/ocaml_lsp_server.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ let code_action (state : State.t) (params : CodeActionParams.t) =
179179
let* doc = Fiber.return (Document_store.get store uri) in
180180
let code_action (kind, f) =
181181
match params.context.only with
182-
| Some set when not (List.mem kind ~set) -> Fiber.return (Ok None)
182+
| Some set when not (List.mem set kind ~equal:Poly.equal) ->
183+
Fiber.return (Ok None)
183184
| Some _
184185
| None ->
185186
let+ action_opt = f () in
@@ -250,7 +251,7 @@ let markdown_support (client_capabilities : ClientCapabilities.t) ~field =
250251
| None -> false
251252
| Some format ->
252253
let set = Option.value format ~default:[ MarkupKind.Markdown ] in
253-
List.mem MarkupKind.Markdown ~set)
254+
List.mem set MarkupKind.Markdown ~equal:Poly.equal)
254255

255256
let location_of_merlin_loc uri = function
256257
| `At_origin
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ end
8585

8686
let term_supports_color =
8787
lazy
88-
( match Stdlib.Sys.getenv "TERM" with
88+
(match Stdlib.Sys.getenv "TERM" with
8989
| exception Not_found -> false
9090
| "dumb" -> false
91-
| _ -> true )
91+
| _ -> true)
9292

9393
let stdout_supports_color =
9494
lazy (Lazy.force term_supports_color && Unix.isatty Unix.stdout)
@@ -98,16 +98,17 @@ let stderr_supports_color =
9898

9999
let rec tag_handler current_styles ppf styles pp =
100100
Format.pp_print_as ppf 0 (Style.escape_sequence_no_reset styles);
101-
Pp.render ppf pp ~tag_handler:(tag_handler (current_styles @ styles));
101+
Pp.to_fmt_with_tags ppf pp
102+
~tag_handler:(tag_handler (current_styles @ styles));
102103
Format.pp_print_as ppf 0 (Style.escape_sequence current_styles)
103104

104105
let make_printer supports_color ppf =
105106
let f =
106107
lazy
107-
( if Lazy.force supports_color then
108-
Pp.render ppf ~tag_handler:(tag_handler [])
108+
(if Lazy.force supports_color then
109+
Pp.to_fmt_with_tags ppf ~tag_handler:(tag_handler [])
109110
else
110-
Pp.render_ignore_tags ppf )
111+
Pp.to_fmt ppf)
111112
in
112113
Staged.stage (fun pp ->
113114
Lazy.force f pp;
@@ -182,7 +183,7 @@ let parse_line str styles =
182183
| _ -> s :: styles)
183184
|> List.rev
184185
in
185-
loop styles (seq_end + 1) acc )
186+
loop styles (seq_end + 1) acc)
186187
in
187188
loop styles 0 Pp.nop
188189

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ let singleton x k = x :: k
77
let to_list l = l []
88

99
let ( @ ) a b k = a (b k)
10+
11+
let rec concat l k =
12+
match l with
13+
| [] -> k
14+
| t :: l -> t (concat l k)

vendor/stdune/appendable_list.mli renamed to vendor/stdune-unstable/appendable_list.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ val singleton : 'a -> 'a t
99

1010
val ( @ ) : 'a t -> 'a t -> 'a t
1111

12+
val concat : 'a t list -> 'a t
13+
1214
val to_list : 'a t -> 'a list
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module Make (A : Applicative_intf.S1_base) = struct
1+
module type Basic = Applicative_intf.Basic
2+
3+
module Make (A : Applicative_intf.Basic) = struct
24
include A
35

46
module O = struct
@@ -21,6 +23,7 @@ module Make (A : Applicative_intf.S1_base) = struct
2123
and+ xs = all xs in
2224
x :: xs
2325
end
26+
[@@inlined always]
2427

2528
module Id = struct
2629
include Make (struct
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module type Basic = Applicative_intf.Basic
2+
3+
module Make (A : Basic) : Applicative_intf.S with type 'a t := 'a A.t
4+
[@@inlined always]
5+
6+
module Id : Applicative_intf.S with type 'a t = 'a

0 commit comments

Comments
 (0)