Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support formatting multiple-language documents #568

Open
Niols opened this issue Jul 7, 2023 · 1 comment
Open

Support formatting multiple-language documents #568

Niols opened this issue Jul 7, 2023 · 1 comment
Labels
epic: language-support Relates to the number of languages Topiary supports and how well they are supported P2 major: an upcoming release type: feature request

Comments

@Niols
Copy link
Member

Niols commented Jul 7, 2023

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:

  • A personal project of mine would be to write a formatter for LilyPond, but LilyPond files regularly include some Guile code and I would want to support that too.

  • The OCaml ecosystem contains some other languages, namely OCamlLex, OCamlYacc and Menhir. Those languages are not super complicated but they involve chunks of OCaml that need formatting as well.

  • Other examples that don't concern me right now but might still matter to others: Markdown, Typst (probably?), languages that use fancy comments (see eg. the link above), web files that can include PHP, HTML, CSS, JS, SQL all in one file.

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 ErinvanderVeen added the P2 major: an upcoming release label Jul 7, 2023
@ErinvanderVeen
Copy link
Collaborator

Related: #400

@ErinvanderVeen ErinvanderVeen added the epic: language-support Relates to the number of languages Topiary supports and how well they are supported label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic: language-support Relates to the number of languages Topiary supports and how well they are supported P2 major: an upcoming release type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants