Merlin and lwt.ppx

Pinning the master version of lwt to get a migrate_parsetree-based ppx (for jbuilder), I get constant errors with merlin. Unfortunately, I can’t see what the errors are exactly from vim.

jbuilder created my .merlin file, and placed

FLG -ppx "_build/default/.ppx/lwt.ppx/ppx.exe --as-ppx"

as a line in the file.

  1. –as-ppx is not a valid argument. It appears in the --help, but it not parsed well by ppx.exe.
  2. Even after removing --as-ppx, merlin has errors.
  3. What format of ppx is merlin expecting? Is it not compatible with migrate_parsetree’s driver?

I ran into something similar and had to pin merlin to its dev release:

opam pin add merlin --dev-repo

After that the vim trouble was cleared up. The issue, if I recall correctly, was due to how the latest released version of merlin parses the quoted string in the FLG line.

For details, refer to

https://github.com/janestreet/jbuilder/issues/30

Thanks guys. Pretty soon, I’m going to have to pin the majority of my packages to the dev release. Not that it’s difficult to do thanks to the awesomeness of opam, but I feel like this doesn’t necessarily make for an environment that’s kind to beginners, who wouldn’t be aware of these things and just bump into issues, eventually giving up.

IMO a bugfix for an issue in a released version necessitates an opam release. This issue is much worse, because it relates to .merlin files created by jbuilder.

1 Like