giraud / reasonml-idea-plugin

ReasonML Language Plugin for IDEA
https://giraud.github.io/reasonml-idea-plugin/
MIT License
338 stars 22 forks source link

Enhancement: support .mlg files #118

Closed jfehrle closed 1 year ago

jfehrle commented 5 years ago

plugin version: 0.67.2

Description Support .mlg files

.mlg files specify the grammar for a parser. They generally include a bunch of embedded OCaml. It would be great if syntax highlighting, comment a line/block and some of the other basic features worked in .mlg files.

Even better would be to populate the structure panel with the pure OCaml items that appear before GRAMMAR EXTEND Gram. And with a bit more work, maybe include grammar symbol definitions in the structure panel.

Here is an example .mlg file: https://github.com/coq/coq/blob/master/plugins/ltac/g_tactic.mlg

giraud commented 5 years ago

done. image

but the grammar section is totally foreign to me. is there any grammar :wink: that describe it ?

jfehrle commented 5 years ago

Thanks, that's much better. The comment/uncomment operations don't work, though.

When I put in the request, I thought .mlg was a general-purpose format, but then I realized that it's specific to the Coq project. Whatever support you can provide would be great, but it may not be something you want to spend much time on.

Nonetheless, the grammar file is in https://github.com/coq/coq/tree/master/coqpp. Looks like coqpp_parse.mly is the yacc input file, coqpp_lex.mll is the lex input file.

It would also be helpful if the plugin supported .mll and .mly files to some degree--they are general purpose formats though I don't know how widely they're used in OCaml.

giraud commented 5 years ago

I added some highlighting to mll mly. if needed, create more specific issues, thanks.

giraud commented 1 year ago

Not working anymore in 0.113, need to implement the same host injection like what has been done in mll/mly

giraud commented 1 year ago

better parsing of mlg, with correct ocaml parser used in injection blocks. support syntax highlighting and folding. image