Dune ppx_expect and merlin(ocaml-lsp) not working

I am using expect_tests in my module, however I am getting the error below from possibly (??) merlin/ocaml-lsp.

My dune file:

 (name lib1)
 (public_name lib1)
  (pps ppx_expect ppx_inline_test)))

ppx_expect: extension is disabled because the tests would be ignored (the build system didn’t pass -inline-test-lib)

Is there some setting that I need to configure?

The dune stanza looks good.

Are you using recent versions of dune and ppx_expect?

dune : 2.7.1
ppx_expect: 0.14.1
ocamllsp : 1.2.0

same error with both vscode/ocamllsp and merlin.

Note: dune runtest works correctly, i.e. no errors or warnings.

Not sure if this is helpful but the error seems to have resolved if I install ppx_deriving version 5.1. So when installing ppx_deriving 5.1, it downgrades the following packages,

↘ downgrade ocaml-migrate-parsetree 2.1.0 to 1.8.0     [required by ppx_deriving]
↘ downgrade ppxlib                  0.20.0 to 0.15.0   [required by ppx_deriving]
↘ downgrade ocamlformat             0.16.0 to 0.15.0   [uses ocaml-migrate-parsetree]
↘ downgrade ppx_expect              v0.14.1 to v0.14.0 [uses ppxlib]

So I am guessing the issue is in one of the packages above and not dune/ocaml-lsp per se.

1 Like

I don’t have a solution, but I’d like to mention that somebody recently filed an issue for the same problem: https://github.com/ocaml/ocaml-lsp/issues/310