atom-language-rust
atom-language-rust copied to clipboard
Turn TextMate grammar to json
Several IDEs like VSCode or Eclipse IDE are reusing (or planning to reuse) the TextMate grammar defined in rust.cson. However, it seems like those cannot parse .cson files, so they translate it to .json: https://github.com/Microsoft/vscode/blob/8fdf170a0850c1cc027382f31650aaf300d3ae2a/extensions/rust/syntaxes/rust.tmLanguage.json . Would it be possible to make the grammar in this repo directly a .json file? Would there be anything lost if doing so? Moving to .json has several benefits like easier reusability in other tools, but also as .json has more and better edition support across various editors/IDEs which make it easier to maintain than .cson in general. If this is acceptable, then it seems mostly a matter of just pulling the VSCode translation and cleaning the info messages.
cc @aeschli @Boereck
I agree that it should be as easy to use as possible and that cson is an unusual format. Initially, this package was used for Atom only, but now it turned out to be useful for other applications as well, I have no objections to make it more portable by using json instead of cson.
As far as I know, Atom doesn't care if you use cson or json (I'm no Atom expert, so maybe somebody else can confirm this). However, I'm not sure how other packages depend on these files (npm lists marky-markdown
and hl
as dependants), so this change should probably introduce a new minor version then.
I could make the PR for it, but I think in order to be cleaner in term of IP, it'd better be @aeschli providing the PR as he has the copyright for the "translation" effort.
Our converter removes some properties and adds some information. So don't use what's in VSCode as starting point. Better take the original rust.cson and use the cson-parser
node module to convert from cson to JSON.
Is there any progress here?