ocaml / merlin

Context sensitive completion for OCaml in Vim and Emacs
https://ocaml.github.io/merlin/
MIT License
1.57k stars 233 forks source link

optcomp/cppo syntax support? #202

Open rgrinberg opened 10 years ago

rgrinberg commented 10 years ago

Not sure how this would even work in theory but it would be nice if merlin at least didn't report them as syntax errors.

trefis commented 10 years ago

Hi! I'm pretty sure I had a branch about that somewhere, at some point. I'll try to find it again; I'll let you know.

UnixJunkie commented 9 years ago

For cppo, I think it should be quite easy: merlin should ignore all lines starting with blanks followed by a '#' and the lines hereafter as long as they end with a '\'.

From the cppo manual: a cppo directive is a '#' sign placed at the beginning of a line, possibly preceded by some whitespace, and followed by a valid directive name or by a number: [...] Directives can be split into multiple lines by placing a backslash \ at the end of the line to be continued.

UnixJunkie commented 9 years ago

There is a request for cppo support in merlin just now on caml-list by Dmitry Bely. https://sympa.inria.fr/sympa/arc/caml-list/2015-08/msg00179.html

let-def commented 8 years ago

I spent some time on this issue. While not too hard to implement, Merlin architecture doesn't suit this case well. Refactoring is going on, this will come in a few months :/.

rgrinberg commented 8 years ago

This is actually a much lower priority for me now that optcomp has been converted with ppx. Would be cool to have this though.

gasche commented 8 years ago

It's not clear to me that optcomp is really converted to ppx. Isn't it rather the ppx driver provided by jane street that also integrates optcomp processing? My understanding is that it is defined as a custom lexer, so before the proper ppx level, and in particular it is not clear (to me) that it would be supported by Merlin as other ppx are -- but it should also be possible to implement it at the lexer level in Merlin.

trefis commented 8 years ago

The optcomp mechanism in janestreet's driver is indeed not a ppx and does not work with merlin.

whitequark commented 8 years ago

@def-lkb any update on this?

little-arhat commented 8 years ago

Would also love to have this in merlin

fpottier commented 4 years ago

This would be useful. However, just having Merlin ignore cppo directives won't cut it. Merlin must actually run cppo, with appropriate command line options.