2

I'm already familiar with the injectionScope property when writing an injection grammar for Visual Studio Code.

However, I've come across some grammars also using an injections property, for example here: https://github.com/pushqrdx/vscode-inline-html/blob/master/syntaxes/es6.inline.html.json, and I can't find any documentation about it. What is it used for?

Gama11
  • 31,714
  • 9
  • 78
  • 100

1 Answers1

1

injectionScope controls where the main grammar from a file is injected. "injectionSelector": L:source.js -comment -string for example injects the file's main grammar into JavaScript code that is not a string or comment.

injections is a set of additional injection grammars. These are separate from the main file's grammar and take the form of a map from injection selectors to rules (a grammar). You can think of these as little injection grammars that are bundled into another grammar's file.

Matt Bierner
  • 58,117
  • 21
  • 175
  • 206