Open Kakadu opened 3 years ago
Not investigated yet, but this seems related to https://github.com/ocaml/dune/issues/4169
-pp not accepting an AST is an open issue: ocaml/merlin#966
I went with merlin-extend in the end as is used by the reason project. [amended] if merlin allowed an external parser (to AST) that might disable its ability to do incremental parsing. On the other hand ppxlib incorporates the ocaml parser and so is a compiler frontend and I don't know how merlin exactly handles that. Perhaps the generated ppx.exe is used only in '-as-ppx' mode by merlin whereby parsing control might be retained.
(Cross post from https://discuss.ocaml.org/t/using-merlin-with-camlp5/7082)
I created demo project where I use external preprocess for a library and PPX-based one. Both seems to create files with contents type "OCaml abstract syntax tree implementation file (Version 027)" but for custom preprocessor merlin can't read the generated file. It looks like that it tries to parse it as plain text file.
Using automatically compiled PPX rewriter doesn't raise that error.
Any idea where the issue can be?