pvl / abap.tmbundle

TextMate support for ABAP
21 stars 9 forks source link

Json/yaml conversion #19

Open FreHu opened 6 years ago

FreHu commented 6 years ago

The grammar is not very easy to read or edit in xml format. I'm suggesting removing the xml and converting it to json or yaml. Both can be done automatically. I'm personally more familiar with json, but a big advantage of yaml is that it allows comments, which would improve maintainability, so I'd prefer that.

According to https://github.com/github/linguist/issues/4231, the grammar can be replaced by a different format as long as the naming conventions mentioned in the issue are met.

What do you guys think? @larshp - we already talked about it on slack, you were against maintaining two formats at once as it would lead to unnecessary extra work and weren't sure about how linguist would react. Both of these are solved - only one format will be kept and linguist will pick up the new format with their next release. @pvl - as the original author, do you have any opinions on this?

mbtools commented 2 years ago

Someone did the conversion to JSON already and added it to their repo:

https://github.com/shikijs/shiki https://github.com/shikijs/shiki/blob/main/packages/shiki/languages/abap.tmLanguage.json

I suggest switching to that format since it's already working.

PS: The conversion is based on this repo: https://github.com/shikijs/shiki/blob/68ddea2bd554426e227d99f2b0c31b2ef1e24b9e/scripts/grammarSources.ts#L84

FreHu commented 2 years ago

1) The conversion does some strange things, it will have to be cleaned up https://github.com/shikijs/shiki/blob/bfba7fc163025bdf01b2d151f6bb5bef28eaa20b/packages/shiki/languages/abap.tmLanguage.json#L309

2) https://github.com/larshp/vscode-abap/blob/main/syntaxes/abap.tmLanguage should also be changed afterwards