Do the IDEs work with PPXs

Does any of the modern IDEs (not VI or EMACS) work with PPXs?

I’m not sure which IDE you are using, or what you mean by working with ppx, but any editor/IDE that has support for merlin should be fine.

While not an IDE per se, but vscode for example can handle ocaml files with ppx just fine. It uses https://github.com/reasonml-editor/vscode-reasonml which in turn depends on merlin.

1 Like

Just to expand: since PPXes do not change the syntactic rules of the language, they should not require special editor support beyond the general support for the language.

1 Like

Thanks for the answer. This was what I was looking for.

One additional question thou:
Is it possible say in VSCode with the reasonable plugin to jump to the „definition“ of a value. For example what’s would happen if would position my cursor on a call to person_of_sexp and try to do a „go to definition“ command?

Similarly, how would I execute „show references“ command for something like person_of_sexp“?

I don’t know much about VSCode, but stuff like this is what Tuareg/Merlin do for you in Emacs.

When you try to “go-to-definition” on a datatype that derives sexp (ex: person_of_sexp) vscode will take you the type definition of person type person = {name: string; age: int} [@@deriving sexp]

Find all references will work as expected: it will show all places where person_of_sexp is used.

42%20PM

Right click on an element shows the option to find all reference. The result is as below:

2 Likes

My vscode does not indent correctly, that’s the main reason I’m still using noevim.