Skip to content

Use another format for tmLanguage #15

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

Closed
PanAeon opened this issue Mar 22, 2019 · 4 comments · Fixed by #20
Closed

Use another format for tmLanguage #15

PanAeon opened this issue Mar 22, 2019 · 4 comments · Fixed by #20

Comments

@PanAeon
Copy link
Contributor

PanAeon commented Mar 22, 2019

Can we use something different then tmLangage ?

The xml syntax makes it super hard to read, and prevents me personally to make any contributions.

The file format is very simple, so we can use CSON, YAML, typescript, scala ... as a source language, that would be compiled by some very simple pipeline to the tmLanguage file, or event better to the tmLanguage.json file (which can be validated against json schema).

I think the chosen format should support at least comments and string interpolation, without string interpolation complex regexes become super tangled. Also we can use plain yaml as template and interpolate variables with a preprocessor (but native support is better).

See dhall-tmlanguage.ts for imperfect example of what I mean.

Of course I can do it locally and contribute the resulting tmLanguage file, but then I risk getting superficial changes because I can't guarantee the exact order of fields in the file.

@torkelrogstad
Copy link

Seconded that this is a good idea. I've spent a couple of hours today struggling with the XML file, and it's one of the most frustrating experiences I've had in a while.

@olafurpg
Copy link
Contributor

Thank you for reporting! I'm open for this idea, I agree the dhall-tmlanguage.ts example looks more maintainable. @PanAeon would you be interested in contributing the translation?

@PanAeon
Copy link
Contributor Author

PanAeon commented Apr 30, 2019

@olafurpg sure! I think I'm going to use a typescript DSL which would output a transient tmLanguage.json file, similar to the example above. Good thing about typescript is that people don't have to install any extra tools.

@olafurpg
Copy link
Contributor

Sounds good to me, we're using TypeScript in the Metals extension and it works great. wdyt @nicolasstucki?

BTW, I apologize the slow responses and releases in this repo. It hasn't been exactly clear who's responsible for maintaining this repo so far but I hope we can improve on that in the coming weeks and months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants