Conflict Between `ocaml-lsp-server` 1.25.0 and `ocamlformat-mlx` Version Constraints in opam

I use the **MLX** dialect and want the functionality of **ocamlformat-mlx** to be integrated into the **OCaml Platform** (or another VSCode extension). I want the **Ctrl+Alt+L** auto-formatting to apply to **.mlx** files the same way **ocamlformat** does for **.ml**.

In the **Platform 2.0.0** release I saw **.mlx** support. I assume the Platform relies on **ocaml-lsp-server**. **ocaml-lsp-server 1.25.0** introduced support for **.mlx** + **ocamlformat-mlx**.

Problem:

**ocaml-lsp-server = 1.25.0** requires **OCaml ≥ 5.4**, while the latest **ocamlformat-mlx** requires **OCaml < 5.4**. When I installed **ocaml-lsp-server = 1.25.0** on **OCaml 5.4**, the Platform required **ocamlformat-mlx**. Then `opam install ocamlformat-mlx` required downgrading to **OCaml 5.3**, which removed **ocaml-lsp-server = 1.25.0**.

I do not understand opam package management and compiler switches well. The standard approach does not allow installing them together, which is confusing because the maintainers released these versions, so it must work for them.

Somehow on Windows I installed everything under **OCaml 5.3**, and it worked. Now I need the same setup in **VSCode WSL**, which does not allow it.

It looks like it might need a release? You could try opam pin add ocamlformat-mlx --dev-repo

1 Like