Injected languages are important for languages like `HTML` which might embed `CSS` or `JavaScript` code blocks. ## Example Use Cases - `HTML` implements `CSS`, `JavaScript` - `JavaScript` implements `regex`, `jsdoc`, `HTML/React` ## Injections.scm Some grammars that support injections have an additional `injections.scm` file in their `queries` folder. An example is [tree-sitter-html](https://github.com/tree-sitter/tree-sitter-html): ``` ((script_element (raw_text) @injection.content) (#set! injection.language "javascript")) ((style_element (raw_text) @injection.content) (#set! injection.language "css")) ``` We need to figure out how to parse and load the associated injected languages in addition to the base language itself. ## Resources - https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection
Activity
austincondiff commentedon Jun 17, 2022
Good point. I can also see this being useful when writing regex or jsx in javascript.
[-]Injected Languages[/-][+]✨ Injected Languages[/+]Add Injected Language Support (#150)
(fix: CodeEditApp#9) Grayscale Selection When Not Focused (CodeEditAp…