Skip to content

Commit

Permalink
Merge c792703 into 66abbbd
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Jun 19, 2023
2 parents 66abbbd + c792703 commit 97bb689
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ jobs:
- windows-latest
ocaml-compiler:
- 4.14.x
- 5.0.x
- ocaml-variants.5.1.0+trunk
exclude:
- os: windows-latest
ocaml-compiler: 5.0.x
- os: windows-latest
ocaml-compiler: ocaml-variants.5.1.0+trunk
- os: macos-latest
ocaml-compiler: 5.0.x
- os: macos-latest
ocaml-compiler: ocaml-variants.5.1.0+trunk

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -60,20 +71,26 @@ jobs:
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
- name: Install opam packages
- name: Build and install opam packages
run: opam install .

# the makefile explains why we don't use test dependencies
# the makefile explains why we don't use --with-test
# ppx expect is not yet compatible with 5.1 and test output vary from one
# compiler to another. We only test on 4.14.
- name: Install test dependencies
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make install-test-deps

- name: Run build
- name: Run build @all
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make all

- name: Run the unit tests
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make test-ocaml

- name: Run the template integration tests
if: matrix.ocaml-compiler == '4.14.x'
run: opam exec -- make test-e2e

coverage:
Expand Down
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Unreleased

## Fixes

## Features

- Support building with OCaml 5.0 and 5.1 (#1150)

# 1.16.0

## Fixes
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ possible and does not make any assumptions about IO.
(csexp (>= 1.5))
(ocamlformat-rpc-lib (>= 0.21.0))
(odoc :with-doc)
ocaml
(ocaml (and (>= 4.14) (< 5.2)))
(merlin-lib (and (>= 4.9) (< 5.0)))))

(package
Expand Down
2 changes: 1 addition & 1 deletion ocaml-lsp-server.opam
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ depends: [
"csexp" {>= "1.5"}
"ocamlformat-rpc-lib" {>= "0.21.0"}
"odoc" {with-doc}
"ocaml"
"ocaml" {>= "4.14" & < "5.2"}
"merlin-lib" {>= "4.9" & < "5.0"}
]
dev-repo: "git+https://github.com/ocaml/ocaml-lsp.git"
Expand Down
7 changes: 3 additions & 4 deletions ocaml-lsp-server/src/folding_range.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ let fold_over_parsetree (parsetree : Mreader.parsetree) =
let range = Range.of_loc module_expr.pmod_loc in
push range;
Ast_iterator.default_iterator.module_expr self module_expr
| Parsetree.Pmod_ident _
| Parsetree.Pmod_apply (_, _)
| Parsetree.Pmod_constraint (_, _)
| Parsetree.Pmod_unpack _ | Parsetree.Pmod_extension _ ->
| _ ->
(* We rely on the wildcard pattern to improve compatibility with
multiple OCaml's parsetree versions *)
Ast_iterator.default_iterator.module_expr self module_expr
in

Expand Down
8 changes: 5 additions & 3 deletions ocaml-lsp-server/src/semantic_highlighting.ml
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ end = struct
self.attributes self pld_attributes

let value_binding (self : Ast_iterator.iterator)
({ pvb_pat; pvb_expr; pvb_attributes; pvb_loc = _ } as vb :
Parsetree.value_binding) =
({ pvb_pat; pvb_expr; pvb_attributes; _ } as vb : Parsetree.value_binding)
=
match
match (pvb_pat.ppat_desc, pvb_expr.pexp_desc) with
| Parsetree.Ppat_var fn_name, _ -> (
Expand Down Expand Up @@ -749,7 +749,9 @@ end = struct
self.module_type self mt);
`Custom_iterator
| Pmod_extension _ -> `Custom_iterator
| Pmod_unpack _ | Pmod_apply (_, _) | Pmod_structure _ ->
| _ ->
(* We rely on the wildcard pattern to improve compatibility with
multiple OCaml's parsetree versions *)
`Default_iterator
with
| `Custom_iterator -> self.attributes self pmod_attributes
Expand Down

0 comments on commit 97bb689

Please sign in to comment.