From ca4546f1b54f43ec826f9c2d03ecbb98b31c8515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 14:27:34 +0100 Subject: [PATCH 01/13] lmao that was it? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- .gitmodules | 3 +++ dune | 1 + dune-project | 31 ++++++------------------------- linol-eio.opam | 2 -- linol-lwt.opam | 2 -- linol.opam | 4 ++-- vendor/ocaml-lsp | 1 + 7 files changed, 13 insertions(+), 31 deletions(-) create mode 100644 .gitmodules create mode 100644 dune create mode 160000 vendor/ocaml-lsp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..d7cd049e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/ocaml-lsp"] + path = vendor/ocaml-lsp + url = https://github.com/ocaml/ocaml-lsp.git diff --git a/dune b/dune new file mode 100644 index 00000000..94865487 --- /dev/null +++ b/dune @@ -0,0 +1 @@ +(vendored_dirs vendor) diff --git a/dune-project b/dune-project index b987704a..813936c6 100644 --- a/dune-project +++ b/dune-project @@ -28,17 +28,14 @@ "logs" ("trace" (>= "0.4")) - ("lsp" - (and - (>= "1.19") - (< "1.23"))) - ("jsonrpc" - (and - (>= "1.19") - (< "1.23"))) ("ocaml" (>= "4.14")) - ("odoc" :with-doc))) + ("odoc" :with-doc) + ; The following dependencies are needed for lsp, which we vendor + (uutf + (>= 1.0.2)) + (ppx_yojson_conv_lib + (>= "v0.14")))) (package (name linol-lwt) @@ -53,14 +50,6 @@ (and (>= "5.1") (< "6.0"))) - ("lsp" - (and - (>= "1.19") - (< "1.23"))) - ("jsonrpc" - (and - (>= "1.19") - (< "1.23"))) ("odoc" :with-doc))) (package @@ -78,12 +67,4 @@ (>= "1.0") (< "2.0"))) (eio_main :with-test) - ("lsp" - (and - (>= "1.19") - (< "1.23"))) - ("jsonrpc" - (and - (>= "1.19") - (< "1.23"))) ("odoc" :with-doc))) diff --git a/linol-eio.opam b/linol-eio.opam index 0b9f10e6..22898f62 100644 --- a/linol-eio.opam +++ b/linol-eio.opam @@ -14,8 +14,6 @@ depends: [ "base-unix" "eio" {>= "1.0" & < "2.0"} "eio_main" {with-test} - "lsp" {>= "1.19" & < "1.23"} - "jsonrpc" {>= "1.19" & < "1.23"} "odoc" {with-doc} ] build: [ diff --git a/linol-lwt.opam b/linol-lwt.opam index dea3ef32..cf2cceab 100644 --- a/linol-lwt.opam +++ b/linol-lwt.opam @@ -13,8 +13,6 @@ depends: [ "linol" {= version} "base-unix" "lwt" {>= "5.1" & < "6.0"} - "lsp" {>= "1.19" & < "1.23"} - "jsonrpc" {>= "1.19" & < "1.23"} "odoc" {with-doc} ] build: [ diff --git a/linol.opam b/linol.opam index 3b624558..5579adc1 100644 --- a/linol.opam +++ b/linol.opam @@ -12,10 +12,10 @@ depends: [ "yojson" {>= "1.6"} "logs" "trace" {>= "0.4"} - "lsp" {>= "1.19" & < "1.23"} - "jsonrpc" {>= "1.19" & < "1.23"} "ocaml" {>= "4.14"} "odoc" {with-doc} + "uutf" {>= "1.0.2"} + "ppx_yojson_conv_lib" {>= "v0.14"} ] build: [ ["dune" "subst"] {pinned} diff --git a/vendor/ocaml-lsp b/vendor/ocaml-lsp new file mode 160000 index 00000000..aae69863 --- /dev/null +++ b/vendor/ocaml-lsp @@ -0,0 +1 @@ +Subproject commit aae6986391a8519de3da6a7a341f2bd3376e0d2f From 7f1c20700a2a9a8172fb8c0e0d65db3057d01d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 14:47:35 +0100 Subject: [PATCH 02/13] remove lsp dependency in dune files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- src/dune | 4 ++-- src/linol-lsp/dune | 4 ++++ src/linol-lsp/import.ml | 3 +++ src/linol-lsp/jsonrpc0.ml | 1 + src/linol-lsp/lsp0.ml | 1 + src/lwt/dune | 4 ++-- 6 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 src/linol-lsp/dune create mode 100644 src/linol-lsp/import.ml create mode 100644 src/linol-lsp/jsonrpc0.ml create mode 100644 src/linol-lsp/lsp0.ml diff --git a/src/dune b/src/dune index 965dc0be..b888bf16 100644 --- a/src/dune +++ b/src/dune @@ -2,5 +2,5 @@ (name linol) (public_name linol) (private_modules log) - (flags :standard -warn-error -a+8) - (libraries yojson lsp logs threads trace.core)) + (flags :standard -warn-error -a+8 -open Linol_lsp.Import) + (libraries yojson linol_lsp logs threads trace.core)) diff --git a/src/linol-lsp/dune b/src/linol-lsp/dune new file mode 100644 index 00000000..ac1782d6 --- /dev/null +++ b/src/linol-lsp/dune @@ -0,0 +1,4 @@ +(library + (name linol_lsp) + (public_name linol.lsp) + (libraries lsp jsonrpc)) diff --git a/src/linol-lsp/import.ml b/src/linol-lsp/import.ml new file mode 100644 index 00000000..f39d45c7 --- /dev/null +++ b/src/linol-lsp/import.ml @@ -0,0 +1,3 @@ +module Lsp = Lsp0 + +module Jsonrpc = Jsonrpc0 \ No newline at end of file diff --git a/src/linol-lsp/jsonrpc0.ml b/src/linol-lsp/jsonrpc0.ml new file mode 100644 index 00000000..011837a4 --- /dev/null +++ b/src/linol-lsp/jsonrpc0.ml @@ -0,0 +1 @@ +include Jsonrpc \ No newline at end of file diff --git a/src/linol-lsp/lsp0.ml b/src/linol-lsp/lsp0.ml new file mode 100644 index 00000000..8ef3e58e --- /dev/null +++ b/src/linol-lsp/lsp0.ml @@ -0,0 +1 @@ +include Lsp \ No newline at end of file diff --git a/src/lwt/dune b/src/lwt/dune index 109364d6..a2a36075 100644 --- a/src/lwt/dune +++ b/src/lwt/dune @@ -1,5 +1,5 @@ (library (name linol_lwt) (public_name linol-lwt) - (libraries yojson lwt lwt.unix linol lsp jsonrpc) - (flags :standard -warn-error -a)) + (libraries yojson lwt lwt.unix linol linol_lsp) + (flags :standard -warn-error -a -open Linol_lsp.Import)) From 68314089eedd5902d20e80e586062da1f71d02bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 15:01:06 +0100 Subject: [PATCH 03/13] forgot to import linol_lsp in eio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- src/eio/dune | 4 ++-- src/lwt/dune | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eio/dune b/src/eio/dune index 101c0a3f..8b872012 100644 --- a/src/eio/dune +++ b/src/eio/dune @@ -1,5 +1,5 @@ (library (name linol_eio) (public_name linol-eio) - (libraries eio eio.unix linol) - (flags :standard -warn-error -a)) + (libraries eio eio.unix linol linol.lsp) + (flags :standard -warn-error -a -open Linol_lsp.Import)) diff --git a/src/lwt/dune b/src/lwt/dune index a2a36075..39cc60f2 100644 --- a/src/lwt/dune +++ b/src/lwt/dune @@ -1,5 +1,5 @@ (library (name linol_lwt) (public_name linol-lwt) - (libraries yojson lwt lwt.unix linol linol_lsp) + (libraries yojson lwt lwt.unix linol linol.lsp) (flags :standard -warn-error -a -open Linol_lsp.Import)) From 09d9ccce046fc130fbd43fdf88ee7e37bf3077f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 16:09:24 +0100 Subject: [PATCH 04/13] test because opammmm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- dune-project | 4 +++- linol-eio.opam | 4 ++-- linol.opam | 4 ++-- src/dune | 4 ++-- src/eio/dune | 4 ++-- src/linol-lsp/dune | 4 ---- src/linol-lsp/import.ml | 3 --- src/linol-lsp/jsonrpc0.ml | 1 - src/linol-lsp/lsp0.ml | 1 - src/linol.ml | 1 + src/linol_lsp.ml | 2 ++ src/lwt/dune | 4 ++-- vendor/ocaml-lsp | 2 +- 13 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 src/linol-lsp/dune delete mode 100644 src/linol-lsp/import.ml delete mode 100644 src/linol-lsp/jsonrpc0.ml delete mode 100644 src/linol-lsp/lsp0.ml create mode 100644 src/linol_lsp.ml diff --git a/dune-project b/dune-project index 813936c6..82e6e252 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,6 @@ -(lang dune 2.0) +(lang dune 3.0) + +(using cinaps 1.0) ;(implicit_transitive_deps false) diff --git a/linol-eio.opam b/linol-eio.opam index 22898f62..81c5f9c7 100644 --- a/linol-eio.opam +++ b/linol-eio.opam @@ -8,7 +8,7 @@ license: "MIT" homepage: "https://github.com/c-cube/linol" bug-reports: "https://github.com/c-cube/linol/issues" depends: [ - "dune" {>= "2.0"} + "dune" {>= "3.0"} "yojson" {>= "1.6"} "linol" {= version} "base-unix" @@ -17,7 +17,7 @@ depends: [ "odoc" {with-doc} ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" diff --git a/linol.opam b/linol.opam index 5579adc1..29e8142d 100644 --- a/linol.opam +++ b/linol.opam @@ -8,7 +8,7 @@ license: "MIT" homepage: "https://github.com/c-cube/linol" bug-reports: "https://github.com/c-cube/linol/issues" depends: [ - "dune" {>= "2.0"} + "dune" {>= "3.0"} "yojson" {>= "1.6"} "logs" "trace" {>= "0.4"} @@ -18,7 +18,7 @@ depends: [ "ppx_yojson_conv_lib" {>= "v0.14"} ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" diff --git a/src/dune b/src/dune index b888bf16..8e81d40c 100644 --- a/src/dune +++ b/src/dune @@ -2,5 +2,5 @@ (name linol) (public_name linol) (private_modules log) - (flags :standard -warn-error -a+8 -open Linol_lsp.Import) - (libraries yojson linol_lsp logs threads trace.core)) + (flags :standard -warn-error -a+8) + (libraries yojson logs threads trace.core lsp jsonrpc)) diff --git a/src/eio/dune b/src/eio/dune index 8b872012..0552d80f 100644 --- a/src/eio/dune +++ b/src/eio/dune @@ -1,5 +1,5 @@ (library (name linol_eio) (public_name linol-eio) - (libraries eio eio.unix linol linol.lsp) - (flags :standard -warn-error -a -open Linol_lsp.Import)) + (libraries eio eio.unix linol.lso linol.jsonrpc) + (flags :standard -warn-error -a)) diff --git a/src/linol-lsp/dune b/src/linol-lsp/dune deleted file mode 100644 index ac1782d6..00000000 --- a/src/linol-lsp/dune +++ /dev/null @@ -1,4 +0,0 @@ -(library - (name linol_lsp) - (public_name linol.lsp) - (libraries lsp jsonrpc)) diff --git a/src/linol-lsp/import.ml b/src/linol-lsp/import.ml deleted file mode 100644 index f39d45c7..00000000 --- a/src/linol-lsp/import.ml +++ /dev/null @@ -1,3 +0,0 @@ -module Lsp = Lsp0 - -module Jsonrpc = Jsonrpc0 \ No newline at end of file diff --git a/src/linol-lsp/jsonrpc0.ml b/src/linol-lsp/jsonrpc0.ml deleted file mode 100644 index 011837a4..00000000 --- a/src/linol-lsp/jsonrpc0.ml +++ /dev/null @@ -1 +0,0 @@ -include Jsonrpc \ No newline at end of file diff --git a/src/linol-lsp/lsp0.ml b/src/linol-lsp/lsp0.ml deleted file mode 100644 index 8ef3e58e..00000000 --- a/src/linol-lsp/lsp0.ml +++ /dev/null @@ -1 +0,0 @@ -include Lsp \ No newline at end of file diff --git a/src/linol.ml b/src/linol.ml index 334942e2..7b454b72 100644 --- a/src/linol.ml +++ b/src/linol.ml @@ -3,6 +3,7 @@ Abstraction over The "Lsp" library, to make it easier to develop LSP servers in OCaml (but not necessarily {b for} OCaml). *) + module type IO = Sigs.IO module Jsonrpc2 = Jsonrpc2 diff --git a/src/linol_lsp.ml b/src/linol_lsp.ml new file mode 100644 index 00000000..68ffa06e --- /dev/null +++ b/src/linol_lsp.ml @@ -0,0 +1,2 @@ +module Lsp0 = Lsp +module Jsonrpc0 = Jsonrpc \ No newline at end of file diff --git a/src/lwt/dune b/src/lwt/dune index 39cc60f2..f9f58db1 100644 --- a/src/lwt/dune +++ b/src/lwt/dune @@ -1,5 +1,5 @@ (library (name linol_lwt) (public_name linol-lwt) - (libraries yojson lwt lwt.unix linol linol.lsp) - (flags :standard -warn-error -a -open Linol_lsp.Import)) + (libraries yojson lwt lwt.unix linol linol.lsp linol.jsonrpc) + (flags :standard -warn-error -a)) diff --git a/vendor/ocaml-lsp b/vendor/ocaml-lsp index aae69863..c9b55bcb 160000 --- a/vendor/ocaml-lsp +++ b/vendor/ocaml-lsp @@ -1 +1 @@ -Subproject commit aae6986391a8519de3da6a7a341f2bd3376e0d2f +Subproject commit c9b55bcbb5471c6f1954bd82a8597b489e28cad7 From 60a573a202a5d4b5f2cc37cca15a0ba0212e00e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 16:20:49 +0100 Subject: [PATCH 05/13] test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d7cd049e..eda390f3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "vendor/ocaml-lsp"] path = vendor/ocaml-lsp - url = https://github.com/ocaml/ocaml-lsp.git + url = https://github.com/giltho/ocaml-lsp.git From b188de9c7dee7b226c3e22c2a862f9e7f255bee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 16:22:27 +0100 Subject: [PATCH 06/13] minor changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- linol-lwt.opam | 4 ++-- src/eio/dune | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linol-lwt.opam b/linol-lwt.opam index cf2cceab..84039de7 100644 --- a/linol-lwt.opam +++ b/linol-lwt.opam @@ -8,7 +8,7 @@ license: "MIT" homepage: "https://github.com/c-cube/linol" bug-reports: "https://github.com/c-cube/linol/issues" depends: [ - "dune" {>= "2.0"} + "dune" {>= "3.0"} "yojson" {>= "1.6"} "linol" {= version} "base-unix" @@ -16,7 +16,7 @@ depends: [ "odoc" {with-doc} ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" diff --git a/src/eio/dune b/src/eio/dune index 0552d80f..8b146804 100644 --- a/src/eio/dune +++ b/src/eio/dune @@ -1,5 +1,5 @@ (library (name linol_eio) (public_name linol-eio) - (libraries eio eio.unix linol.lso linol.jsonrpc) + (libraries eio eio.unix linol linol.lsp linol.jsonrpc) (flags :standard -warn-error -a)) From 213f7164a723f640b9ba0665508b2754bacb92c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 16:42:06 +0100 Subject: [PATCH 07/13] much simpler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- .gitmodules | 6 +++--- dune | 2 +- submodules/ocaml-lsp | 1 + vendor/jsonrpc/dune | 5 +++++ vendor/lsp/dune | 14 ++++++++++++++ vendor/ocaml-lsp | 1 - 6 files changed, 24 insertions(+), 5 deletions(-) create mode 160000 submodules/ocaml-lsp create mode 100644 vendor/jsonrpc/dune create mode 100644 vendor/lsp/dune delete mode 160000 vendor/ocaml-lsp diff --git a/.gitmodules b/.gitmodules index eda390f3..32c92e0b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "vendor/ocaml-lsp"] - path = vendor/ocaml-lsp - url = https://github.com/giltho/ocaml-lsp.git +[submodule "submodules/ocaml-lsp"] + path = submodules/ocaml-lsp + url = https://github.com/ocaml/ocaml-lsp.git diff --git a/dune b/dune index 94865487..171ef1c3 100644 --- a/dune +++ b/dune @@ -1 +1 @@ -(vendored_dirs vendor) +(data_only_dirs submodules) diff --git a/submodules/ocaml-lsp b/submodules/ocaml-lsp new file mode 160000 index 00000000..aae69863 --- /dev/null +++ b/submodules/ocaml-lsp @@ -0,0 +1 @@ +Subproject commit aae6986391a8519de3da6a7a341f2bd3376e0d2f diff --git a/vendor/jsonrpc/dune b/vendor/jsonrpc/dune new file mode 100644 index 00000000..28e23310 --- /dev/null +++ b/vendor/jsonrpc/dune @@ -0,0 +1,5 @@ +(copy_files %{project_root}/submodules/ocaml-lsp/jsonrpc/src/*.{ml,mli}) + +(library + (name jsonrpc) + (public_name linol.jsonrpc)) diff --git a/vendor/lsp/dune b/vendor/lsp/dune new file mode 100644 index 00000000..d67c7436 --- /dev/null +++ b/vendor/lsp/dune @@ -0,0 +1,14 @@ +(copy_files %{project_root}/submodules/ocaml-lsp/lsp/src/*.{ml,mli,mll}) + +(library + (name lsp) + (public_name linol.lsp) + (libraries jsonrpc ppx_yojson_conv_lib uutf yojson) + (lint + (pps ppx_yojson_conv))) + +(cinaps + (files types.ml types.mli) + (libraries lsp_gen)) + +(ocamllex uri_lexer) diff --git a/vendor/ocaml-lsp b/vendor/ocaml-lsp deleted file mode 160000 index c9b55bcb..00000000 --- a/vendor/ocaml-lsp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9b55bcbb5471c6f1954bd82a8597b489e28cad7 From aae7605aff26d1a5c64f3aa4e46d2a447f5c74eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 16:45:42 +0100 Subject: [PATCH 08/13] re-expose lsp and jsonrpc without requiring lsp.linol and lsp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- src/linol.ml | 4 ++++ vendor/lsp/dune | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/linol.ml b/src/linol.ml index 7b454b72..b9bb632c 100644 --- a/src/linol.ml +++ b/src/linol.ml @@ -3,6 +3,10 @@ Abstraction over The "Lsp" library, to make it easier to develop LSP servers in OCaml (but not necessarily {b for} OCaml). *) +module Imports = struct + module Lsp = Lsp + module Jsonrpc = Jsonrpc +end module type IO = Sigs.IO diff --git a/vendor/lsp/dune b/vendor/lsp/dune index d67c7436..95ebe38e 100644 --- a/vendor/lsp/dune +++ b/vendor/lsp/dune @@ -7,8 +7,4 @@ (lint (pps ppx_yojson_conv))) -(cinaps - (files types.ml types.mli) - (libraries lsp_gen)) - (ocamllex uri_lexer) From 9b5d77990a7dd60078c02bfc75292ab965edf6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 16:52:47 +0100 Subject: [PATCH 09/13] back to dune 2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- dune-project | 4 +--- linol-eio.opam | 4 ++-- linol-lwt.opam | 4 ++-- linol.opam | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dune-project b/dune-project index 82e6e252..813936c6 100644 --- a/dune-project +++ b/dune-project @@ -1,6 +1,4 @@ -(lang dune 3.0) - -(using cinaps 1.0) +(lang dune 2.0) ;(implicit_transitive_deps false) diff --git a/linol-eio.opam b/linol-eio.opam index 81c5f9c7..22898f62 100644 --- a/linol-eio.opam +++ b/linol-eio.opam @@ -8,7 +8,7 @@ license: "MIT" homepage: "https://github.com/c-cube/linol" bug-reports: "https://github.com/c-cube/linol/issues" depends: [ - "dune" {>= "3.0"} + "dune" {>= "2.0"} "yojson" {>= "1.6"} "linol" {= version} "base-unix" @@ -17,7 +17,7 @@ depends: [ "odoc" {with-doc} ] build: [ - ["dune" "subst"] {dev} + ["dune" "subst"] {pinned} [ "dune" "build" diff --git a/linol-lwt.opam b/linol-lwt.opam index 84039de7..cf2cceab 100644 --- a/linol-lwt.opam +++ b/linol-lwt.opam @@ -8,7 +8,7 @@ license: "MIT" homepage: "https://github.com/c-cube/linol" bug-reports: "https://github.com/c-cube/linol/issues" depends: [ - "dune" {>= "3.0"} + "dune" {>= "2.0"} "yojson" {>= "1.6"} "linol" {= version} "base-unix" @@ -16,7 +16,7 @@ depends: [ "odoc" {with-doc} ] build: [ - ["dune" "subst"] {dev} + ["dune" "subst"] {pinned} [ "dune" "build" diff --git a/linol.opam b/linol.opam index 29e8142d..5579adc1 100644 --- a/linol.opam +++ b/linol.opam @@ -8,7 +8,7 @@ license: "MIT" homepage: "https://github.com/c-cube/linol" bug-reports: "https://github.com/c-cube/linol/issues" depends: [ - "dune" {>= "3.0"} + "dune" {>= "2.0"} "yojson" {>= "1.6"} "logs" "trace" {>= "0.4"} @@ -18,7 +18,7 @@ depends: [ "ppx_yojson_conv_lib" {>= "v0.14"} ] build: [ - ["dune" "subst"] {dev} + ["dune" "subst"] {pinned} [ "dune" "build" From b3e7de8bbeb8345ffbe3d8c4606d083a3607cbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 17:13:15 +0100 Subject: [PATCH 10/13] checkout submodules in ci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- .github/workflows/gh-pages.yml | 3 ++- .github/workflows/main.yml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f96d7c1f..bb3f943d 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@main - + with: + submodules: 'recursive' - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: '5.2' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ee99513..cce2c037 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@main + with: + submodules: 'recursive' - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} @@ -44,6 +46,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@main + with: + submodules: 'recursive' - uses: ocaml/setup-ocaml@v3 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} From 60dc752c7789a322f4a578aecbbe1f17e8088f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 17:15:08 +0100 Subject: [PATCH 11/13] don't install lsp/jsonrpc in CI... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- .github/workflows/main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cce2c037..20ad873d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,10 +39,6 @@ jobs: - 5.1.x - 5.2.x - 5.3.x - lsp-version: - - 1.19.0 - - 1.20.1 - - 1.22.0 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@main @@ -54,8 +50,6 @@ jobs: dune-cache: true allow-prerelease-opam: true - run: opam pin -n . - - run: opam pin add jsonrpc ${{ matrix.lsp-version }} - - run: opam pin add lsp ${{ matrix.lsp-version }} - run: opam depext -yt linol linol-lwt linol-eio - run: opam install -t . --deps-only - run: opam exec -- dune build From 5ba6f40a3c3704455bf11696f0d05e8330b0f0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sacha-=C3=89lie=20Ayoun?= Date: Thu, 3 Apr 2025 17:20:32 +0100 Subject: [PATCH 12/13] remove useless file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sacha-Élie Ayoun --- src/linol_lsp.ml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 src/linol_lsp.ml diff --git a/src/linol_lsp.ml b/src/linol_lsp.ml deleted file mode 100644 index 68ffa06e..00000000 --- a/src/linol_lsp.ml +++ /dev/null @@ -1,2 +0,0 @@ -module Lsp0 = Lsp -module Jsonrpc0 = Jsonrpc \ No newline at end of file From 5b264f9f67b43a5d760feffc66e324bd71bd3652 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 7 Apr 2025 13:31:04 -0400 Subject: [PATCH 13/13] fixes and updates --- Makefile | 3 +++ example/template-eio/main.ml | 2 ++ example/template-lwt/main.ml | 2 ++ src/common_.ml | 2 ++ src/dune | 2 +- src/eio/linol_eio.ml | 4 ++++ src/jsonrpc2.mli | 1 + src/linol.ml | 11 +++++++---- src/lwt/linol_lwt.ml | 4 ++++ vendor/jsonrpc/dune | 2 +- vendor/lsp/dune | 5 +++-- 11 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8764344b..26420bd2 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,9 @@ clean: doc: @dune build @doc +update-submodules: + @git submodule update --init + VERSION=$(shell awk '/^version:/ {print $$2}' linol.opam) update_next_tag: diff --git a/example/template-eio/main.ml b/example/template-eio/main.ml index 932e0cfa..88f01b3a 100644 --- a/example/template-eio/main.ml +++ b/example/template-eio/main.ml @@ -15,6 +15,8 @@ of a document are expected to be able to return. *) +module Lsp = Linol.Lsp + type state_after_processing = unit let process_some_input_file (_file_contents : string) : state_after_processing = diff --git a/example/template-lwt/main.ml b/example/template-lwt/main.ml index 42e0ea26..5e952ffb 100644 --- a/example/template-lwt/main.ml +++ b/example/template-lwt/main.ml @@ -15,6 +15,8 @@ of a document are expected to be able to return. *) +module Lsp = Linol.Lsp + type state_after_processing = unit let process_some_input_file (_file_contents : string) : state_after_processing = diff --git a/src/common_.ml b/src/common_.ml index 78a5810a..d883a936 100644 --- a/src/common_.ml +++ b/src/common_.ml @@ -1,3 +1,5 @@ +module Lsp = Linol_lsp.Lsp +module Jsonrpc = Linol_jsonrpc.Jsonrpc module Trace = Trace_core let ( let@ ) = ( @@ ) diff --git a/src/dune b/src/dune index 8e81d40c..6c66594f 100644 --- a/src/dune +++ b/src/dune @@ -3,4 +3,4 @@ (public_name linol) (private_modules log) (flags :standard -warn-error -a+8) - (libraries yojson logs threads trace.core lsp jsonrpc)) + (libraries yojson logs threads trace.core (re_export linol.lsp) (re_export linol.jsonrpc))) diff --git a/src/eio/linol_eio.ml b/src/eio/linol_eio.ml index a3cb606c..a95ea20a 100644 --- a/src/eio/linol_eio.ml +++ b/src/eio/linol_eio.ml @@ -1,3 +1,7 @@ +open struct + module Lsp = Linol_lsp.Lsp +end + module type IO = Linol.IO module IO_eio : diff --git a/src/jsonrpc2.mli b/src/jsonrpc2.mli index 2ed46b04..4f96e796 100644 --- a/src/jsonrpc2.mli +++ b/src/jsonrpc2.mli @@ -2,6 +2,7 @@ See {{: https://www.jsonrpc.org/specification} the spec} *) +open Common_ type json = Yojson.Safe.t module type IO = Sigs.IO diff --git a/src/linol.ml b/src/linol.ml index b9bb632c..3d841d54 100644 --- a/src/linol.ml +++ b/src/linol.ml @@ -3,13 +3,16 @@ Abstraction over The "Lsp" library, to make it easier to develop LSP servers in OCaml (but not necessarily {b for} OCaml). *) -module Imports = struct - module Lsp = Lsp - module Jsonrpc = Jsonrpc -end module type IO = Sigs.IO +(** {2 Re-export from vendored lsp} *) + +module Lsp = Linol_lsp.Lsp +module Jsonrpc = Linol_jsonrpc.Jsonrpc + +(** {2 Main modules} *) + module Jsonrpc2 = Jsonrpc2 module Server = Server module Blocking_IO = Blocking_IO diff --git a/src/lwt/linol_lwt.ml b/src/lwt/linol_lwt.ml index 432527bf..d295fe29 100644 --- a/src/lwt/linol_lwt.ml +++ b/src/lwt/linol_lwt.ml @@ -1,3 +1,7 @@ +open struct + module Lsp = Linol_lsp.Lsp +end + module type IO = Linol.IO module IO_lwt : diff --git a/vendor/jsonrpc/dune b/vendor/jsonrpc/dune index 28e23310..8429aec2 100644 --- a/vendor/jsonrpc/dune +++ b/vendor/jsonrpc/dune @@ -1,5 +1,5 @@ (copy_files %{project_root}/submodules/ocaml-lsp/jsonrpc/src/*.{ml,mli}) (library - (name jsonrpc) + (name linol_jsonrpc) (public_name linol.jsonrpc)) diff --git a/vendor/lsp/dune b/vendor/lsp/dune index 95ebe38e..8e6d1ae4 100644 --- a/vendor/lsp/dune +++ b/vendor/lsp/dune @@ -1,9 +1,10 @@ (copy_files %{project_root}/submodules/ocaml-lsp/lsp/src/*.{ml,mli,mll}) (library - (name lsp) + (name linol_lsp) (public_name linol.lsp) - (libraries jsonrpc ppx_yojson_conv_lib uutf yojson) + (libraries linol_jsonrpc ppx_yojson_conv_lib uutf yojson) + (flags :standard -open Linol_jsonrpc) (lint (pps ppx_yojson_conv)))