You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor(extension): clean up embedded language configuration
The embeddedLanguages configuration of a grammer is meant to map scope name to the name of the language
for that scope.
* refactor(syntaxes): Only inject template scopes to html
Template scopes do not need to be injected directly to source.ts.
Instead, template scopes apply when inline templates have been matched
in TS files and are included as patterns under that match.
The Angular template syntaxes _could_ be directly injected into TS like
they are now. This would apply them to any embedded `text.html` in a TS file.
This change applies Angular template grammars only to embedded HTML
matched by the inline template grammar (strings under `template:` of a
decorator).
`injectTo` applies only to the top-level file language and not embedded
labguages. So our `injectTo` `text.html` will not automatically apply to
inline templates simply by setting the `contentName` and language.
It would also be nice to further limit our grammars to apply only to
files that we know are Angular templates rather than injecting to every
to-level `.html` file.
In the future we might want to explore _not_ injecting into all top-level
`html` and then using `injectionSelector` to control from there. This
approach makes it difficult for environments that support
many frameworks/languages (stackblitz/textmate#4).
We might be able to create an "angular" language for `.component.html` and `.ng.html` files and use
our grammars only for those extensions rather than injecting them into
any and all `html`.
0 commit comments