Repository navigation
Conversation
|
@0Miles is attempting to deploy a commit to the Aoyue Team on Vercel. A member of the Team first needs to authorize it. |
Two TextMate grammar fixes verified by direct vscode-textmate tokenization (scripts in /tmp/grammar-test/). master-co#361: comment scope guard - Adds -comment to injection selectors in injection-{class,react, vue,string}.json, aligning with injection-js.json which already had it - Defense-in-depth: TSX/HTML host grammars already absorb comment scope, but the guard makes the contract explicit and matches VSCode convention #217: | styling + bg:url(/foo.png) mis-parse - The | separator captured name: "comment.block" — semantically wrong. Changed to punctuation.separator.master-css - The class-selector lookbehind (?<![|/]) was too loose; .png inside bg:url(/foo.png) had o (not |//) before . and matched as a CSS class. Tightened to (?<![A-Za-z0-9_\-|/]) so a class selector only fires at a token boundary - Regression: bg:white .btn — the .btn after a space still tokenizes as entity.other.attribute-name.class.css Honest caveat for master-co#361: the same comment exclusion happens on rc without this fix, because TSX/HTML host grammars already shield comment regions. The guard is structurally correct but the user- visible symptom may have a different root cause. #217 is fully verified by tokenization. packages/language/ has no test infra today; adding fixture-snapshot tests is its own work-item. Closes master-co#361 Closes #217
87c8ea2 to
bac45d1
Compare
|
Retracting. The #217 portion ( The #361 portion is the concern: my Plan: split into two PRs — one for #217 (high confidence, will re-submit shortly) and one for #361 (after I get a concrete VSCode session repro from the original reporter, or the issue gets clearer test fixtures). Branch preserved. |
Closes #361, #217.
Summary
Two TextMate grammar fixes:
#361 — comment scope guard
`master-css.injection-{class,react,vue,string}.json` injection selectors didn't exclude comment scopes. Only `injection-js.json` had `-comment` in its selector. This PR aligns the four others, defense-in-depth for comment-toggle scenarios.
```diff
-"injectionSelector": "L:meta.tag,L:source.mdx"
+"injectionSelector": "L:meta.tag -comment, L:source.mdx -comment"
```
#217 — `|` styling + `bg:url(/foo.png)` mis-parse
`master-css.json` had two regex bugs:
Verification
Used `vscode-textmate` + Shiki-bundled host grammars to tokenize fixture lines:
Honest caveat for #361
The same comment exclusion happens on `rc` without my fix, because TSX/HTML host grammars already absorb the comment scope and don't surface inner `string.quoted`/`meta.tag` scopes that the master-css injection selector would match. The `-comment` guard is defense-in-depth — structurally correct, matching VSCode convention — but the user-visible symptom in #361 may have a different root cause (e.g. `classNames(...)` function-call context, language-configuration commentToken). The fix is worth keeping; it's not strictly proven to address the user's exact scenario.
`#217` is fully verified by tokenization.
Repro scripts
`/tmp/grammar-test/` (vscode-textmate + vscode-oniguruma + shiki for host grammars). `packages/language/` has no test infra today; adding fixture-snapshot tests is its own work-item.