Commit 26a2739
committed
feat(vscode): derive the Vue TextMate grammars with Monogram
Replace the hand-written Vue syntax grammars with ones derived by Monogram from a
single proven Vue/HTML grammar. The main SFC grammar and the two injections
(directives + interpolations) are now generated output.
The injections keep the same scopeNames (vue.directives / vue.interpolations),
selectors, and injectTo set, and remain thin stubs that include
text.html.vue#vue-directives / #vue-interpolations (the rule bodies live in the main
grammar's repository) — the same topology as before.
The <template> body now embeds text.html.derivative (the embedded-HTML-fragment scope
VS Code's HTML extension provides), which is what the interpolation injection targets.
Notable behaviour change: an `as` type assertion in a directive value
(#5012 / #6007 / #2096 / #520) no longer eats the closing quote — the derived grammar
bounds the value with a capture-embed, so `:msg="msg as string"` recovers correctly
after the cast instead of leaking TypeScript across the rest of the tag.
Grammar snapshot regenerated (extensions/vscode/tests/grammar.spec.ts).1 parent 5d4e9fa commit 26a2739
4 files changed
Lines changed: 2856 additions & 1718 deletions
File tree
- extensions/vscode
- syntaxes
- tests/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
0 commit comments