Use textmate / vscode compliant syntax-highlighting in plugin

im making my first plugin, totally new to java, gradle and all this stuff (can i please write intellij plugins in python?!!) i’m adding support for a custom language (redscript, ‘*.reds’, for game modding).

the language is already well defined by open source tools - the language itself with a cli for building etc, an lsp, a dap, a syntax-highlighter. well written and well supported tools that are well integrated into vscode… but i like my intellij tools, so as far as possible i want to simply port those tools.

so far i’ve implemented a language server which uses lsp4ij to proxy the already existing open source lsp. it works, i get click-thru goToDefinition behaviour

now i’m trying to add syntax highlighting, and there already exist open source syntax-highlighting + associated vsCode plugin. in intelliJ UI i can import the vscode plugin and get syntax highlighting from it - how can i do the same in my plugin and avoid formally describing the language in 1st-party intelliJ syntax?

i guess i need to extend TextMateBundles, or something like that? but despite finding the intellij textmate plugin source i can’t work out how to do it.

or how else do i use the existing regex gramar redscript.tmLanguage.json in my plugin?

any help well appreciated…

TextMate plugin allows 3rd party plugins to provide custom bundles, see IntelliJ Community Plugins Extension Point and Listener List | IntelliJ Platform Plugin SDK

When you click on the Extension Point name, you can browse existing OSS plugins using it as reference.

See also Explore the IntelliJ Platform API | IntelliJ Platform Plugin SDK for more strategies.