2 years ago
#70591
Pochi
How to inject an embedded language to tagged template strings on JavaScript?
I'm trying to contribute a grammar for an embedded language within JavaScript's tagged template strings. I'm able to inject the grammar in all template strings in the file. However, I'm interested only on tagged templates. Having the following JavaScript file:
const notTagged = ` do not inject here`;
const tagget = myparser`Foo(1 , (1+ 41))`; //Inject/apply the grammar here.
i would like to inject the grammar on the second line of the program (i.e., the tagged template). Concretely, I would like to know how to specify this using the "injectionSelector" property of the grammar, cause at the moment I can only do "injectionSelector":"L:string.template.js"
that matches all string templates on the JavaScript file.
javascript
vscode-extensions
0 Answers
Your Answer