VSCode Extension - Grammar Injection Into Multiple Languages

27 views Asked by At

I'd like my extension to apply to both HTMl and Markdown.

I understand I can use

"injectTo": [
    "text.html.derivative"
    "text.html.markdown"
],

But that doesn't work on it's own because I need to somehow have both in

"injectionSelector": "L:text.html.derivative",

How do I add Markdown to my injectionSelection in addition to HTML?

1

There are 1 answers

0
zacoons On

I found a workaround by treating it as a language rather than a grammar injection and simply including text.html.derivative and text.html.markdown in the tmLanguage.json file.