On 8 Jul 2020, at 2:52, John DeSoi wrote:

I'm trying to create a language bundle where it will not be possible to identify all the scopes correctly using regular expressions. Is there a way to generate the scope dynamically somehow?

I think you are asking for something like an “overlay”, i.e. in addition to the base grammar, a plug-in would provide additional highlighting?

This is not supported, it may be supported when we get LSP support, as I believe they have an API for that, though it would require writing your own parser.

What we do for C/Objective-C is to generate Platform.tmLanguage that has the (I believe) > 10,000 platform symbols, and then that gets included by the main grammar, although it will not work for dynamic things like the user’s custom types and classes.

https://github.com/textmate/objective-c.tmbundle/blob/master/Syntaxes/Platform.tmLanguage