Skip to content

Add YAML syntax highlighting rules for modern PackageDev scope names#42

Open
kstlouis wants to merge 1 commit into
nordtheme:developfrom
kstlouis:feat/yaml-syntax-highlighting
Open

Add YAML syntax highlighting rules for modern PackageDev scope names#42
kstlouis wants to merge 1 commit into
nordtheme:developfrom
kstlouis:feat/yaml-syntax-highlighting

Conversation

@kstlouis

@kstlouis kstlouis commented Apr 7, 2026

Copy link
Copy Markdown

�[38;2;216;222;233m 1�[0m �[38;2;216;222;233mCloses #41�[0m
�[38;2;216;222;233m 2�[0m
�[38;2;216;222;233m 3�[0m �[38;2;216;222;233m## Summary�[0m
�[38;2;216;222;233m 4�[0m
�[38;2;216;222;233m 5�[0m �[38;2;216;222;233mThe existing YAML rule targets source.yaml entity.name.tag (old-style scope naming), but the current Sublime Text YAML syntax package (PackageDev) emits scopes with language suffixes baked into the scope name (e.g. entity.name.tag.yaml). Because Sublime Text's scope matching is prefix-based, the old rule never fires against these modern scopes, leaving keys, values, booleans, numbers, and punctuation all unstyled.�[0m
�[38;2;216;222;233m 6�[0m
�[38;2;216;222;233m 7�[0m �[38;2;216;222;233mThis PR adds five new rules targeting the modern .yaml-suffixed scopes, using existing Nord palette variables consistent with how equivalent token types are styled in other languages (e.g. JSON). The original [YAML] Entity Name Tag rule is preserved unchanged for backwards compatibility with any syntax packages still using the old convention.�[0m
�[38;2;216;222;233m 8�[0m
�[38;2;216;222;233m 9�[0m �[38;2;216;222;233m## Scope mapping�[0m
�[38;2;216;222;233m 10�[0m
�[38;2;216;222;233m 11�[0m �[38;2;216;222;233m| Token | Scope | Color |�[0m
�[38;2;216;222;233m 12�[0m �[38;2;216;222;233m|---|---|---|�[0m
�[38;2;216;222;233m 13�[0m �[38;2;216;222;233m| Keys | meta.mapping.key.yaml string.unquoted.plain.out.yaml | var(nord_tag) — nord9 |�[0m
�[38;2;216;222;233m 14�[0m �[38;2;216;222;233m| String values | string.unquoted.plain.out.yaml, string.unquoted.block.yaml, string.quoted.double.yaml, string.quoted.single.yaml | var(nord_string) — nord14 |�[0m
�[38;2;216;222;233m 15�[0m �[38;2;216;222;233m| Booleans | constant.language.boolean.true.yaml, constant.language.boolean.false.yaml | var(nord_number) — nord15 |�[0m
�[38;2;216;222;233m 16�[0m �[38;2;216;222;233m| Numbers | constant.numeric.yaml | var(nord_number) — nord15 |�[0m
�[38;2;216;222;233m 17�[0m �[38;2;216;222;233m| Punctuation | punctuation.definition.block.sequence.item.yaml, punctuation.separator.key-value.mapping.yaml | var(nord_punctuation) — nord6 |�[0m
�[38;2;216;222;233m 18�[0m
�[38;2;216;222;233m 19�[0m �[38;2;216;222;233m## Testing�[0m
�[38;2;216;222;233m 20�[0m
�[38;2;216;222;233m 21�[0m �[38;2;216;222;233mScope names were verified against a live YAML file using Sublime Text's built-in scope inspector (Tools → Developer → Show Scope Name). The color choices were validated for consistency against the existing JSON rules in the theme.�[0m

…ting rules for modern scope names�[0m

�[38;2;216;222;233m   2�[0m
�[38;2;216;222;233m   3�[0m �[38;2;216;222;233mThe existing rule targets `source.yaml entity.name.tag` (old-style scope�[0m
�[38;2;216;222;233m   4�[0m �[38;2;216;222;233mnaming) but the current Sublime Text YAML syntax package emits scopes with�[0m
�[38;2;216;222;233m   5�[0m �[38;2;216;222;233mlanguage suffixes (e.g. `entity.name.tag.yaml`). This left most YAML tokens�[0m
�[38;2;216;222;233m   6�[0m �[38;2;216;222;233munstyled, falling through to the default foreground color.�[0m
�[38;2;216;222;233m   7�[0m
�[38;2;216;222;233m   8�[0m �[38;2;216;222;233mAdd rules for keys, string values, booleans, numbers, and punctuation using�[0m
�[38;2;216;222;233m   9�[0m �[38;2;216;222;233mthe modern `.yaml`-suffixed scopes emitted by the PackageDev YAML syntax.�[0m
@kstlouis kstlouis requested a review from svengreb as a code owner April 7, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant