|
2 | 2 | // side effects on import). The "official" YAML grammar is the MAINTAINED RedCMD/YAML-Syntax- |
3 | 3 | // Highlighter (microsoft/vscode#232244 switched VS Code off the dead textmate/yaml.tmbundle to it), |
4 | 4 | // so YAML's baseline is a maintained competitor — most of these it ALSO solves. Each id cites the |
5 | | -// underlying upstream tracker; the canonical aggregator is RedCMD/YAML-Syntax-Highlighter#1 |
6 | | -// ("Pre-existing grammar issues"), which links the VS Code / textmate-yaml.tmbundle / atom-language- |
7 | | -// yaml issues. The original report against Monogram was johnsoncodehk/monogram#12, since superseded |
8 | | -// by RedCMD's organized #1. Shared by the README cross-language ✓ table (test/issue-table.ts). |
| 5 | +// most specific tracker: the ecosystem bugs filed against the official/upstream grammars (VS Code / |
| 6 | +// textmate-yaml.tmbundle / atom-language-yaml), and johnsoncodehk/monogram#12 ("YAML issues", |
| 7 | +// RedCMD's multi-item report against Monogram) for the explicit-key behaviors that have no single |
| 8 | +// dedicated upstream issue. RedCMD/YAML-Syntax-Highlighter#1 ("Pre-existing grammar issues") is the |
| 9 | +// broader cross-ecosystem aggregator that links the upstream issues. Shared by the README |
| 10 | +// cross-language ✓ table (test/issue-table.ts). |
9 | 11 | // |
10 | 12 | // Each snippet is VALID YAML; the question is whether the grammar scopes the marked span correctly. |
11 | 13 | // Same predicate shape as html-issue-cases.ts: {id, title, src, at, nth?, want:(scope)=>boolean}. |
@@ -37,11 +39,11 @@ export const cases: YamlCase[] = [ |
37 | 39 | at: '}', want: isBlockScalar }, // the `}` is literal block-scalar content, not punctuation — and the indicator follows a TAB (tmbundle#18: `{ }` inside literal style breaks highlighting; #17 is the sibling colon case) |
38 | 40 |
|
39 | 41 | // ── explicit-key (`?`) constructs ── |
40 | | - { id: 'RedCMD/YAML-Syntax-Highlighter#1', title: 'an anchor `&a` in explicit-key (`?`) position is still an anchor', src: '? &a a\n: &b b\n: *a\n', |
| 42 | + { id: 'johnsoncodehk/monogram#12', title: 'an anchor `&a` in explicit-key (`?`) position is still an anchor', src: '? &a a\n: &b b\n: *a\n', |
41 | 43 | at: '&a', want: isAnchor }, // `&a` after the explicit-key `?` is an anchor (entity.name.type.anchor / variable.other.anchor), not bare source — the original monogram#12 multi-item repro |
42 | | - { id: 'RedCMD/YAML-Syntax-Highlighter#1', title: 'a bare `?` opening an explicit multi-line sequence key is the map-key indicator', src: '?\n- a\n- b\n:\n- c\n- d\n', |
| 44 | + { id: 'johnsoncodehk/monogram#12', title: 'a bare `?` opening an explicit multi-line sequence key is the map-key indicator', src: '?\n- a\n- b\n:\n- c\n- d\n', |
43 | 45 | at: '?', want: isMapKeyPunct }, // the lone `?` (its value is the multi-line block sequence below) is punctuation.definition.map.key.yaml — both grammars handle the explicit complex-key form |
44 | | - { id: 'RedCMD/YAML-Syntax-Highlighter#1', title: 'a block scalar used AS an explicit key is scoped as a key name', src: '? |\n block key\n: v\n', |
| 46 | + { id: 'johnsoncodehk/monogram#12', title: 'a block scalar used AS an explicit key is scoped as a key name', src: '? |\n block key\n: v\n', |
45 | 47 | at: 'block key', want: isTag }, // MONOGRAM-ONLY ✓: Monogram scopes the block-scalar explicit key as a key NAME (entity.name.tag.yaml); the official leaves it string.unquoted.block (it has no entity.name.tag) → only-Monogram |
46 | 48 |
|
47 | 49 | // ── quoted KEYS carry their escapes / plain scalars carry a string ancestor ── |
|
0 commit comments