danipen / TextMateSharp

A port of tm4e to bring TextMate grammars to dotnet ecosystem
MIT License
101 stars 19 forks source link

Support for XML Plist grammars? #2

Open arvindshmicrosoft opened 3 years ago

arvindshmicrosoft commented 3 years ago

Firstly - thank you for this project!

From what I can see thus far, the grammar needs to be the JSON format only, is that right? Do you have any plans to implement support for the XML Plist grammar similar to what exists in tm4e?

I realize there is a workaround to convert those XML grammars to JSON, so this is a good-to-have feature, albeit lower priority.

Once again, thanks!

danipen commented 3 years ago

Hi yep, at this moment only JSON grammars are supported.

The tm4e implementation uses an XML SAX parser, which notifies start/end when a node is being read.

I didn't find an easy way to do that in dotnet, but I didn't investigate too much because I only needed JSON support.

Supporting PList format should be straightforward using a SAX-based dotnet XML parser, and writing something similar to this, based on parsing XML contents: https://github.com/danipen/TextMateSharp/blob/master/src/TextMateSharp/Internal/Parser/Json/JSONPListParser.cs