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 see there is a TextMate Ctags bundle (https://github.com/textmate/ctags.tmbundle). Does TextMate use CTags to locate and syntax color both functions and variables? Where does the file go and what name does it need to have?
Thanks,
John DeSoi, Ph.D.
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/Platfo...
On Aug 6, 2020, at 2:33 AM, Allan Odgaard mailinglist@textmate.org wrote:
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.
Yes, that is what I'm looking for. I'll look into it when LSP support is available. I have a parser ready to go.
Thanks,
John DeSoi, Ph.D.