Skip to content

Commit 7f416af

Browse files
cknittclaude
andauthored
Work with dune 3.25 and lsp 1.28 (#9295)
* 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gGPsF3fHZn9rBxA7Hm Signed-off-by: Christoph Knittel <ck@cca.io> * 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gGPsF3fHZn9rBxA7Hm Signed-off-by: Christoph Knittel <ck@cca.io> --------- Signed-off-by: Christoph Knittel <ck@cca.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 622016f commit 7f416af

8 files changed

Lines changed: 27 additions & 19 deletions

File tree

‎analysis.opam‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ depends: [
1010
"dune" {>= "3.17"}
1111
"ocaml" {>= "5.0.0"}
1212
"odoc" {with-doc}
13-
"lsp" {= "1.27.0"}
14-
"jsonrpc" {= "1.27.0"}
13+
"lsp" {= "1.28.1"}
14+
"jsonrpc" {= "1.28.1"}
1515
"uutf" {= "1.0.4"}
1616
"ppx_yojson_conv_lib" {>= "v0.16.0" & <= "v0.17.0"}
1717
"yojson" {= "3.0.0"}

‎analysis/src/cli.ml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ let test ~state ~path =
389389
(edit :
390390
[ `AnnotatedTextEdit of
391391
Lsp.Types.AnnotatedTextEdit.t
392+
| `SnippetTextEdit of
393+
Lsp.Types.SnippetTextEdit.t
392394
| `TextEdit of Lsp.Types.TextEdit.t ])
393395
->
394396
let start_char, new_text, range =
@@ -401,6 +403,10 @@ let test ~state ~path =
401403
( te.range.start.character,
402404
te.newText,
403405
te.range )
406+
| `SnippetTextEdit te ->
407+
( te.range.start.character,
408+
te.snippet.value,
409+
te.range )
404410
in
405411
let indent = String.make start_char ' ' in
406412
Printf.printf

‎dune-project‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
(>= 5.0.0))
7878
(odoc :with-doc)
7979
(lsp
80-
(= 1.27.0))
80+
(= 1.28.1))
8181
; Linked into the binaries through lsp.
8282
(jsonrpc
83-
(= 1.27.0))
83+
(= 1.28.1))
8484
(uutf
8585
(= 1.0.4))
8686
; v0.17.0 needs OCaml 5.1; the OCaml 5.0 CI job gets v0.16.0.

‎packages/@rescript/darwin-arm64/THIRD_PARTY_LICENSES‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE.
961961

962962
LSP
963963
===
964-
Version: 1.27.0
964+
Version: 1.28.1
965965
Source: https://github.com/ocaml/ocaml-lsp
966966
License: ISC
967967
Included in: rescript-editor-analysis and rescript-tools
@@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
987987

988988
JSONRPC
989989
=======
990-
Version: 1.27.0
990+
Version: 1.28.1
991991
Source: https://github.com/ocaml/ocaml-lsp
992992
License: ISC
993993
Included in: runtime dependency of LSP

‎packages/@rescript/linux-arm64/THIRD_PARTY_LICENSES‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE.
961961

962962
LSP
963963
===
964-
Version: 1.27.0
964+
Version: 1.28.1
965965
Source: https://github.com/ocaml/ocaml-lsp
966966
License: ISC
967967
Included in: rescript-editor-analysis and rescript-tools
@@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
987987

988988
JSONRPC
989989
=======
990-
Version: 1.27.0
990+
Version: 1.28.1
991991
Source: https://github.com/ocaml/ocaml-lsp
992992
License: ISC
993993
Included in: runtime dependency of LSP

‎packages/@rescript/linux-x64/THIRD_PARTY_LICENSES‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE.
961961

962962
LSP
963963
===
964-
Version: 1.27.0
964+
Version: 1.28.1
965965
Source: https://github.com/ocaml/ocaml-lsp
966966
License: ISC
967967
Included in: rescript-editor-analysis and rescript-tools
@@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
987987

988988
JSONRPC
989989
=======
990-
Version: 1.27.0
990+
Version: 1.28.1
991991
Source: https://github.com/ocaml/ocaml-lsp
992992
License: ISC
993993
Included in: runtime dependency of LSP

‎packages/@rescript/win32-x64/THIRD_PARTY_LICENSES‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ POSSIBILITY OF SUCH DAMAGE.
961961

962962
LSP
963963
===
964-
Version: 1.27.0
964+
Version: 1.28.1
965965
Source: https://github.com/ocaml/ocaml-lsp
966966
License: ISC
967967
Included in: rescript-editor-analysis and rescript-tools
@@ -987,7 +987,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
987987

988988
JSONRPC
989989
=======
990-
Version: 1.27.0
990+
Version: 1.28.1
991991
Source: https://github.com/ocaml/ocaml-lsp
992992
License: ISC
993993
Included in: runtime dependency of LSP

‎scripts/generateThirdPartyLicenses.js‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ const platforms = [
2727
{ packageName: "win32-x64", family: "win32" },
2828
];
2929

30-
// The dune executables in the platform packages, by source directory.
30+
// The dune executables in the platform packages, by source directory, with
31+
// the names `dune describe workspace` may give them: the private name, or
32+
// from dune 3.25 on, the public name when there is one.
3133
const shippedExecutables = new Map([
32-
["compiler/bsc", "rescript_compiler_main"],
33-
["rewatch-ocaml", "rescript_ocaml"],
34-
["analysis/bin", "main"],
35-
["tools/bin", "main"],
34+
["compiler/bsc", ["rescript_compiler_main", "bsc"]],
35+
["rewatch-ocaml", ["rescript_ocaml"]],
36+
["analysis/bin", ["main", "rescript-editor-analysis"]],
37+
["tools/bin", ["main", "rescript-tools"]],
3638
]);
3739

3840
/**
@@ -146,8 +148,8 @@ function linkedOpamPackages() {
146148
const sourceDir = path.posix.dirname(
147149
path.posix.relative("_build/default", impl ?? ""),
148150
);
149-
const name = shippedExecutables.get(sourceDir);
150-
if (name !== undefined && atoms(field(fields, "names")).includes(name)) {
151+
const names = shippedExecutables.get(sourceDir) ?? [];
152+
if (atoms(field(fields, "names")).some(name => names.includes(name))) {
151153
roots.push(fields);
152154
}
153155
}

0 commit comments

Comments
 (0)