merlin icon indicating copy to clipboard operation
merlin copied to clipboard

External preprocessor failure

Open Kakadu opened this issue 5 years ago • 2 comments

(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.

image

Any idea where the issue can be?

Kakadu avatar Jan 26 '21 12:01 Kakadu

Not investigated yet, but this seems related to https://github.com/ocaml/dune/issues/4169

voodoos avatar Jan 28 '21 15:01 voodoos

-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.

progman1 avatar Feb 14 '21 19:02 progman1