Add YAML syntax highlighting rules for modern PackageDev scope names#42
Open
kstlouis wants to merge 1 commit into
Open
Add YAML syntax highlighting rules for modern PackageDev scope names#42kstlouis wants to merge 1 commit into
kstlouis wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
�[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 Tagrule 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