tweag / topiary

https://topiary.tweag.io/
MIT License
575 stars 29 forks source link

Support formatting multiple-language documents #568

Open Niols opened 1 year ago

Niols commented 1 year ago

Is your feature request related to a problem? Please describe.

A lot of languages include other languages in their grammars, which tree-sitter supports somewhat (one can create a leaf that contains the code in the other language) and which some people use to provide fancy syntax highlighting for instance. I would want Topiary to support formatting such languages.

Some examples or use cases:

Additional context

There is currently no formatter for OCamlLex, OCamlYacc and Menhir. ocp-indent has simple support for them. OCamlFormat does not. I think it would be a very good way to distinguish ourselves from OCamlFormat and show the power of tree-sitter and Topiary. I think this would convince quite a few people.

ErinvanderVeen commented 1 year ago

Related: #400