At my workplace, we use a custom scripting language which i made a syntax grammar for to highlight the code structure in vscode.
In this language, we embed blocks of other language code. Which we can do in vscode using embedded language feature. So far everything works.
Now we have another plugin that injects highlighting for TODO
into this embedded language, which works when the file language is set to that language.
Now the issue is when we have the language as embedded language into our own scripting language, then the TODO injection does not seem to apply to it.
I've noticed i can "include" injections by manually specifying them as included, but this only applies them at the top level of the language, not at the injectionScope.
Is there a way to resolve this?
You'll need to inject the TODO language into the parent language
TODO package.json
"injectTo": [
"source.parent.language"
],
and probably refine the injectionSelector
to only target the embedded language etc
todo.tmLanguage.json
"injectionSelector": "L:source.embedded.language comment -string, L:source.other.language comment -string"
or
"injectionSelector": "L:comment -source.parent.language"