dream icon indicating copy to clipboard operation
dream copied to clipboard

ocaml-lsp integration

Open joprice opened this issue 3 years ago • 4 comments

When using ocaml-lsp, html blocks in eml.ml template files cause syntax errors. Is there any integration to make that work, or would the templating have to be implemented as a ppx instead?

joprice avatar Aug 12 '21 22:08 joprice

There is no integration for this at the moment. The main suggestion is to use .eml.html files, as in this example, so that the editor doesn't attempt to highlight them as OCaml in the first place. This is what I personally do — the .eml.ml files are more for tiny apps and examples, in my own usage.

I believe @tmattio was looking into a better integration at one point.

aantron avatar Sep 23 '21 01:09 aantron

A "live" example of .eml.html usage can be found in the source code of the online playground.

aantron avatar Sep 23 '21 01:09 aantron

@joprice You might want to try TyXML's JSX ppx; I wrote up a bit of my reaction/experience after trying a bunch of templating options here, and settled on the JSX ppx quite happily (which does work perfectly with ocaml-lsp).

cemerick avatar Oct 08 '21 04:10 cemerick

Thank you for the suggestion. I'd rather not have to deal with two syntaxes and I actually think I prefer the normal tyxml syntax. I'm going to use that for now and see how it goes.

joprice avatar Oct 10 '21 18:10 joprice