Demonstrates how an extension can inject support for a new grammar in VSCode's builtin markdown grammar for fenced code blocks. This extension injects an alias for JavaScript called superjs so support editor highlighting of blocks that look like:
```superjs
someJsCode
```package.json- VS Code extension manifest file. Thecontributes.grammarssection registers the injected grammar.syntaxes/codeblock.json- The injected grammar itself
- In
syntaxes/codeblock.json, change thebeginrule fromsuperjsto the identifier of your target language. This identifier is what people will write in markdown. - In
syntaxes/codeblock.json, change the innerincluderule from"source.js"to the scope of your target language. This scope can be found by looking at the target language's grammar. - In
syntaxes/codeblock.json, change thecontentNamefrom usingsuperjsto using a identifier for your language. This identifier may only contain letters but does not have to match the identifier from step 1. - In
syntaxes/codeblock.json, change thescopeNamefrom usingsuperjsto using a identifier for your language. This identifier may only contain letters but does not have to match the identifier from step 1. - In
package.json, change thescopeNameto match the scopeName from step 4. - In
package.json, changeembeddedLanguagesto map between thecontentNamefrom step 3 and the VS Code identifier for your language. - In
package.json, change theidfrom usingsuperjs-injectionto using an identifier for your grammar injection. This identifier does not have to match the identifier from step 1. - In
package.json, change thelanguagefrom usingsuperjs-injectionto using an identifier for your grammar injection. This identifier has to match the identifier from step 7.