From ca4093878a35b11a274bc79cc035a6ddc5f41360 Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 31 May 2023 11:25:37 +0100 Subject: [PATCH 1/2] Fix generation of static cmis to match protocol protocol.ml states: ```ocaml type static_cmi = { sc_name : string; (* capitalised, e.g. 'Stdlib' *) sc_content : string; } ``` but the `gen_static` script was generating: ```ocaml {sc_name="Stdlib__Buffer.cmi"; sc_content=[%blob ... ``` Fix is to strip the extension. --- src/worker/static/gen_static.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker/static/gen_static.ml b/src/worker/static/gen_static.ml index 3bccf6a3..c8a25e9b 100644 --- a/src/worker/static/gen_static.ml +++ b/src/worker/static/gen_static.ml @@ -19,7 +19,7 @@ let () = let dir = Unix.opendir stdlib in iter_cmi ~f:(fun file -> let fullpath = Filename.concat stdlib file in - let module_name = Filename.basename file |> String.capitalize_ascii in + let module_name = Filename.basename file |> String.capitalize_ascii |> Filename.remove_extension in Printf.fprintf out "{sc_name=%S; sc_content=[%%blob %S]};" module_name fullpath) dir; Printf.fprintf out "]\n"; From 42032e0adec55bed1497ab91c51b6b1a059fe7d4 Mon Sep 17 00:00:00 2001 From: Jon Ludlam Date: Wed, 31 May 2023 11:38:48 +0100 Subject: [PATCH 2/2] Make the dynamic example cmi requests relative rather than absolute --- example/dynamic.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/dynamic.ml b/example/dynamic.ml index 71d48af0..bfc5f82b 100644 --- a/example/dynamic.ml +++ b/example/dynamic.ml @@ -16,7 +16,7 @@ module Merlin = "Unix"; "UnixLabels"; ] in - let dcs_url = "/stdlib/" in + let dcs_url = "stdlib/" in let dcs_file_prefixes = ["stdlib__"] in { Protocol.static_cmis = []; dynamic_cmis = Some {