Programmatically inject language in custom language highlighter Follow
I am writing a plugin that highlights a custom language. The highlighting is pretty much done already. The language is structured like this:
#-- Start of message1 --#
in a certain
#-- Start of message 2 --#
another random string
Now the part that is indicated as "random" strings is actually not random. Based on the key-value pairs I can infer what language this part is. Notably this could be XML or JSON. My highlighter currently puts both of these into a specific token called 'MESSAGE'. However I would like to use XML or JSON highlighting for this token. Would I use injected languages for this or should I delegate this to a different highlighter somehow?
Please sign in to leave a comment.
Injected language is definitely the way that you should follow.