From d2996dcad7551e9b912e527b187efea84c47223e Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Thu, 12 Nov 2026 20:44:35 +0000 Subject: [PATCH 1/2] Work with dune 3.25 dune 3.25.0 (released 2026-11-12) gives an executable its public name in `dune describe workspace`, so the license check found none of the shipped executables; it now accepts either name. ocaml-lsp-server 1.27.0, which the lsp pin holds the dev setup to, doesn't build against stdune 3.25, so the dev setup keeps stdune below it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Kbf3gGPsF3fHZn9rBxA7Hm Signed-off-by: Christoph Knittel --- dune-project | 4 ++++ rescript.opam | 1 + scripts/generateThirdPartyLicenses.js | 16 +++++++++------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dune-project b/dune-project index 2930333848..af050eb6cf 100644 --- a/dune-project +++ b/dune-project @@ -52,6 +52,10 @@ (odoc :with-doc) (ocaml-lsp-server (and :with-dev-setup (>= 1.23.0))) + ; lsp is held at 1.27.0 (analysis.opam), and so is ocaml-lsp-server, which + ; doesn't build against stdune 3.25. + (stdune + (and :with-dev-setup (< 3.25))) (js_of_ocaml (and (<> :os "win32") diff --git a/rescript.opam b/rescript.opam index 132e77e1b3..e95b9a7d91 100644 --- a/rescript.opam +++ b/rescript.opam @@ -25,6 +25,7 @@ depends: [ "ounit2" {with-test & = "2.2.7"} "odoc" {with-doc} "ocaml-lsp-server" {with-dev-setup & >= "1.23.0"} + "stdune" {with-dev-setup & < "3.25"} "js_of_ocaml" {os != "win32" & with-test & = "6.5.0"} "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.5.0"} "reanalyze" {os != "win32" & with-test & = "2.27.0"} diff --git a/scripts/generateThirdPartyLicenses.js b/scripts/generateThirdPartyLicenses.js index ef5b77909d..4ef6769094 100644 --- a/scripts/generateThirdPartyLicenses.js +++ b/scripts/generateThirdPartyLicenses.js @@ -27,12 +27,14 @@ const platforms = [ { packageName: "win32-x64", family: "win32" }, ]; -// The dune executables in the platform packages, by source directory. +// The dune executables in the platform packages, by source directory, with +// the names `dune describe workspace` may give them: the private name, or +// from dune 3.25 on, the public name when there is one. const shippedExecutables = new Map([ - ["compiler/bsc", "rescript_compiler_main"], - ["rewatch-ocaml", "rescript_ocaml"], - ["analysis/bin", "main"], - ["tools/bin", "main"], + ["compiler/bsc", ["rescript_compiler_main", "bsc"]], + ["rewatch-ocaml", ["rescript_ocaml"]], + ["analysis/bin", ["main", "rescript-editor-analysis"]], + ["tools/bin", ["main", "rescript-tools"]], ]); /** @@ -146,8 +148,8 @@ function linkedOpamPackages() { const sourceDir = path.posix.dirname( path.posix.relative("_build/default", impl ?? ""), ); - const name = shippedExecutables.get(sourceDir); - if (name !== undefined && atoms(field(fields, "names")).includes(name)) { + const names = shippedExecutables.get(sourceDir) ?? []; + if (atoms(field(fields, "names")).some(name => names.includes(name))) { roots.push(fields); } } From bb03256397827c8a9a9230ac4d467c853c0806bd Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Thu, 12 Nov 2026 20:48:08 +0000 Subject: [PATCH 2/2] Move to lsp 1.28 instead of bounding stdune lsp was pinned to 1.27.0 because 1.28 added snippet text edits, which the analysis CLI's edit printing didn't accept; it prints them now. lsp and jsonrpc move to 1.28.1, so the dev setup gets ocaml-lsp-server 1.28.1 instead of 1.27.0, and the stdune bound for it goes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Kbf3gGPsF3fHZn9rBxA7Hm Signed-off-by: Christoph Knittel --- analysis.opam | 4 ++-- analysis/src/cli.ml | 6 ++++++ dune-project | 8 ++------ packages/@rescript/darwin-arm64/THIRD_PARTY_LICENSES | 4 ++-- packages/@rescript/linux-arm64/THIRD_PARTY_LICENSES | 4 ++-- packages/@rescript/linux-x64/THIRD_PARTY_LICENSES | 4 ++-- packages/@rescript/win32-x64/THIRD_PARTY_LICENSES | 4 ++-- rescript.opam | 1 - 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/analysis.opam b/analysis.opam index 982612de8c..7ca6d748a6 100644 --- a/analysis.opam +++ b/analysis.opam @@ -10,8 +10,8 @@ depends: [ "dune" {>= "3.17"} "ocaml" {>= "5.0.0"} "odoc" {with-doc} - "lsp" {= "1.27.0"} - "jsonrpc" {= "1.27.0"} + "lsp" {= "1.28.1"} + "jsonrpc" {= "1.28.1"} "uutf" {= "1.0.4"} "ppx_yojson_conv_lib" {>= "v0.16.0" & <= "v0.17.0"} "yojson" {= "3.0.0"} diff --git a/analysis/src/cli.ml b/analysis/src/cli.ml index bbf599215f..d9fe90a0c1 100644 --- a/analysis/src/cli.ml +++ b/analysis/src/cli.ml @@ -389,6 +389,8 @@ let test ~state ~path = (edit : [ `AnnotatedTextEdit of Lsp.Types.AnnotatedTextEdit.t + | `SnippetTextEdit of + Lsp.Types.SnippetTextEdit.t | `TextEdit of Lsp.Types.TextEdit.t ]) -> let start_char, new_text, range = @@ -401,6 +403,10 @@ let test ~state ~path = ( te.range.start.character, te.newText, te.range ) + | `SnippetTextEdit te -> + ( te.range.start.character, + te.snippet.value, + te.range ) in let indent = String.make start_char ' ' in Printf.printf diff --git a/dune-project b/dune-project index af050eb6cf..bb6aadb6fb 100644 --- a/dune-project +++ b/dune-project @@ -52,10 +52,6 @@ (odoc :with-doc) (ocaml-lsp-server (and :with-dev-setup (>= 1.23.0))) - ; lsp is held at 1.27.0 (analysis.opam), and so is ocaml-lsp-server, which - ; doesn't build against stdune 3.25. - (stdune - (and :with-dev-setup (< 3.25))) (js_of_ocaml (and (<> :os "win32") @@ -81,10 +77,10 @@ (>= 5.0.0)) (odoc :with-doc) (lsp - (= 1.27.0)) + (= 1.28.1)) ; Linked into the binaries through lsp. (jsonrpc - (= 1.27.0)) + (= 1.28.1)) (uutf (= 1.0.4)) ; v0.17.0 needs OCaml 5.1; the OCaml 5.0 CI job gets v0.16.0. diff --git a/packages/@rescript/darwin-arm64/THIRD_PARTY_LICENSES b/packages/@rescript/darwin-arm64/THIRD_PARTY_LICENSES index 4757d25cd6..8da216572d 100644 --- a/packages/@rescript/darwin-arm64/THIRD_PARTY_LICENSES +++ b/packages/@rescript/darwin-arm64/THIRD_PARTY_LICENSES @@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE. LSP === -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: rescript-editor-analysis and rescript-tools @@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. JSONRPC ======= -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: runtime dependency of LSP diff --git a/packages/@rescript/linux-arm64/THIRD_PARTY_LICENSES b/packages/@rescript/linux-arm64/THIRD_PARTY_LICENSES index 2bb8c220a4..b0adace61a 100644 --- a/packages/@rescript/linux-arm64/THIRD_PARTY_LICENSES +++ b/packages/@rescript/linux-arm64/THIRD_PARTY_LICENSES @@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE. LSP === -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: rescript-editor-analysis and rescript-tools @@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. JSONRPC ======= -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: runtime dependency of LSP diff --git a/packages/@rescript/linux-x64/THIRD_PARTY_LICENSES b/packages/@rescript/linux-x64/THIRD_PARTY_LICENSES index ed7de966b0..08b0c9a3e2 100644 --- a/packages/@rescript/linux-x64/THIRD_PARTY_LICENSES +++ b/packages/@rescript/linux-x64/THIRD_PARTY_LICENSES @@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE. LSP === -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: rescript-editor-analysis and rescript-tools @@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. JSONRPC ======= -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: runtime dependency of LSP diff --git a/packages/@rescript/win32-x64/THIRD_PARTY_LICENSES b/packages/@rescript/win32-x64/THIRD_PARTY_LICENSES index e40eafabba..7856590146 100644 --- a/packages/@rescript/win32-x64/THIRD_PARTY_LICENSES +++ b/packages/@rescript/win32-x64/THIRD_PARTY_LICENSES @@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE. LSP === -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: rescript-editor-analysis and rescript-tools @@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. JSONRPC ======= -Version: 1.27.0 +Version: 1.28.1 Source: https://github.com/ocaml/ocaml-lsp License: ISC Included in: runtime dependency of LSP diff --git a/rescript.opam b/rescript.opam index e95b9a7d91..132e77e1b3 100644 --- a/rescript.opam +++ b/rescript.opam @@ -25,7 +25,6 @@ depends: [ "ounit2" {with-test & = "2.2.7"} "odoc" {with-doc} "ocaml-lsp-server" {with-dev-setup & >= "1.23.0"} - "stdune" {with-dev-setup & < "3.25"} "js_of_ocaml" {os != "win32" & with-test & = "6.5.0"} "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.5.0"} "reanalyze" {os != "win32" & with-test & = "2.27.0"}