This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Commit d291a15
committed
Properly inject Angular template grammar in inline templates
It seems that to get inline templates to be syntax highlighted with the
angular template grammar correctly, we not only need to include the
`template.ng` grammar pattern when matching an inline template (which
previously worked only for interpolations but would not seem to
correctly recognize template bindings); we also need to tell VSCode that
it should inject the template grammar in TypeScript files.
I cannot find a way to test this (since it differs from the TextMate
grammar tests, as this change instructs VSCode specifically how to add
the grammars), but screenshots attached to the PR for this commit
demonstrate before- and after-this-change syntax highlight on an inline
template. Furthermore non-template TypeScript should not be matched by
the template grammar, since the template grammar can only be injected
when the base grammar is matched to be HTML (which only happens when we
match an inline template).
I couldn't figure this out a couple months back, but looked back today
and got it almost immediately :) I guess some time away is a good thing.
Closes #7681 parent e9a14b6 commit d291a15
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
0 commit comments