question

shaunpryszlak-2817 avatar image
0 Votes"
shaunpryszlak-2817 asked cooldadtx answered

Writing a custom syntax hilihghter

I have my game definition in a custom text file. XML and JSON were too bulky. Is there an easy way to write a custom syntax hilihghter for visual studio. I have played with ANTLR before so I know the basics of this sort of thing. It is just a couple of keywords, comments, some separators and strings. Notepad++ does something but not that well.

vs-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
1 Vote"
cooldadtx answered

You need a language service for anything too complex. Be warned though that this is complex.

However if you just need basic syntax highlighting then VS 2019 also supports TextMate grammars. That is a lot easier and documented here. This is the way I'd go and then move up to a language service later if advanced features are needed.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.