Re-adopt new YAML grammar! (#232244)

* Embedded languages syntax highlighting stopped working in 1.92.0
Fixes #224978

* Get embedded grammar
This commit is contained in:
Alex Ross
2024-12-10 12:32:57 +01:00
committed by GitHub
parent 461a6983d7
commit 1c91332da7
12 changed files with 1193 additions and 856 deletions

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/71a88711ec184b7dde5240c8f150ad3c2dbbd5f1",
"version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/0b50d9c47145df62c4461c4407698a24e8f1f3c2",
"name": "YAML 1.0",
"scopeName": "source.yaml.1.0",
"comment": "https://yaml.org/spec/1.0/",
@@ -520,8 +520,8 @@
"patterns": [
{
"comment": "https://yaml.org/spec/1.2.2/#8111-block-indentation-indicator",
"begin": "(?>(\\|)|(>))(?<chomp>[+-])?+((0)|(1)|(2)|(3)|(4)|(5)|(6)|(7)|(8)|(9))(?(<chomp>)|([+-]))?+",
"while": "\\G(?>(?>(?!\\5)|(?!\\6) |(?!\\7) {2}|(?!\\8) {3}|(?!\\9) {4}|(?!\\10) {5}|(?!\\11) {6}|(?!\\12) {7}|(?!\\13) {8}|(?!\\14) {9})| *+($|[^#]))",
"begin": "(?>(\\|)|(>))(?<chomp>[+-])?+([0-9])(?(<chomp>)|\\g<chomp>)?+",
"while": "\\G(?> {\\4}| *+($|[^#]))",
"beginCaptures": {
"1": {
"name": "keyword.control.flow.block-scalar.literal.yaml"
@@ -534,9 +534,6 @@
},
"4": {
"name": "constant.numeric.indentation-indicator.yaml"
},
"15": {
"name": "storage.modifier.chomping-indicator.yaml"
}
},
"whileCaptures": {
@@ -571,7 +568,6 @@
]
},
{
"comment": "https://yaml.org/spec/1.2.2/#rule-c-b-block-header",
"//": "Soooooooo many edge cases",
"begin": "(?>(\\|)|(>))([+-]?+)",
"while": "\\G",

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/71a88711ec184b7dde5240c8f150ad3c2dbbd5f1",
"version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/53d38bbc66b704803de54ffce5b251bf97211c60",
"name": "YAML 1.2",
"scopeName": "source.yaml.1.2",
"comment": "https://yaml.org/spec/1.2.2",
@@ -38,7 +38,7 @@
},
{
"comment": "For when YAML is embedded inside a Markdown code-block",
"begin": "\\G",
"begin": "\\G(?!$)",
"while": "\\G",
"name": "meta.stream.yaml",
"patterns": [
@@ -331,10 +331,10 @@
"block-node": {
"patterns": [
{
"include": "#block-sequence"
"include": "#block-mapping"
},
{
"include": "#block-mapping"
"include": "#block-sequence"
},
{
"include": "#block-scalar"
@@ -623,6 +623,10 @@
"match": "[\t ]++$",
"name": "punctuation.whitespace.separator.yaml"
},
{
"match": "[^\r\n\t ](?=[\t ]*+$)",
"name": "invalid.illegal.expected-map-separator.yaml"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
@@ -654,8 +658,8 @@
"patterns": [
{
"comment": "https://yaml.org/spec/1.2.2/#8111-block-indentation-indicator",
"begin": "(?>(\\|)|(>))(?<chomp>[+-])?+((1)|(2)|(3)|(4)|(5)|(6)|(7)|(8)|(9))(?(<chomp>)|([+-]))?+",
"while": "\\G(?>(?>(?!\\5) |(?!\\6) {2}|(?!\\7) {3}|(?!\\8) {4}|(?!\\9) {5}|(?!\\10) {6}|(?!\\11) {7}|(?!\\12) {8}|(?!\\13) {9})| *+($|[^#]))",
"begin": "(?>(\\|)|(>))(?<chomp>[+-])?+([1-9])(?(<chomp>)|\\g<chomp>)?+",
"while": "\\G(?> {\\4}| *+($|[^#]))",
"beginCaptures": {
"1": {
"name": "keyword.control.flow.block-scalar.literal.yaml"
@@ -668,9 +672,6 @@
},
"4": {
"name": "constant.numeric.indentation-indicator.yaml"
},
"14": {
"name": "storage.modifier.chomping-indicator.yaml"
}
},
"whileCaptures": {
@@ -705,7 +706,6 @@
]
},
{
"comment": "https://yaml.org/spec/1.2.2/#rule-c-b-block-header",
"//": "Soooooooo many edge cases",
"begin": "(?>(\\|)|(>))([+-]?+)",
"while": "\\G",
@@ -798,7 +798,7 @@
]
},
{
"comment": "Header Comment",
"comment": "https://yaml.org/spec/1.2.2/#rule-c-b-block-header",
"begin": "\\G",
"end": "$",
"patterns": [
@@ -1279,7 +1279,7 @@
"name": "meta.map.key.yaml string.quoted.double.yaml entity.name.tag.yaml",
"patterns": [
{
"match": "[^\t -\\x{10FFFF}]++",
"match": "[^\r\n\t -\\x{10FFFF}]++",
"name": "invalid.illegal.character.yaml"
},
{
@@ -1614,7 +1614,7 @@
"comment": {
"comment": "Comments must be separated from other tokens by white space characters. `space`, `tab`, `newline` or `carriage-return`. `#(.*)` causes performance issues",
"begin": "(?<=[\\x{FEFF}\t ]|^)#",
"end": "\r|\n",
"end": "$",
"captures": {
"0": {
"name": "punctuation.definition.comment.yaml"

View File

@@ -0,0 +1,502 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml-embedded.tmLanguage.json",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/c42cf86959ba238dc8a825bdd07bed6f5e97c978",
"name": "YAML embedded",
"scopeName": "source.yaml.embedded",
"patterns": [
{
"include": "source.yaml.1.2#byte-order-mark"
},
{
"include": "#directives"
},
{
"include": "#document"
},
{
"include": "#block-sequence"
},
{
"include": "#block-mapping"
},
{
"include": "#block-map-key-explicit"
},
{
"include": "#block-map-value"
},
{
"include": "#block-scalar"
},
{
"include": "source.yaml.1.2#anchor-property"
},
{
"include": "source.yaml.1.2#tag-property"
},
{
"include": "#alias"
},
{
"include": "source.yaml.1.2#double"
},
{
"include": "source.yaml.1.2#single"
},
{
"include": "source.yaml.1.2#flow-mapping"
},
{
"include": "source.yaml.1.2#flow-sequence"
},
{
"include": "#block-plain-out"
},
{
"include": "#presentation-detail"
}
],
"repository": {
"directives": {
"comment": "https://yaml.org/spec/1.2.2/#68-directives",
"patterns": [
{
"comment": "https://yaml.org/spec/1.2.2/#681-yaml-directives",
"begin": "(?>^|\\G)(%)(YAML)([\t ]+)([0-9]+\\.[0-9]*)",
"end": "$",
"beginCaptures": {
"1": {
"name": "punctuation.definition.directive.begin.yaml"
},
"2": {
"name": "keyword.other.directive.yaml.yaml"
},
"3": {
"name": "punctuation.whitespace.separator.yaml"
},
"4": {
"name": "constant.numeric.yaml-version.yaml"
}
},
"name": "meta.directives.yaml",
"patterns": [
{
"include": "#presentation-detail"
}
]
},
{
"comment": "https://yaml.org/spec/1.2.2/#682-tag-directives",
"begin": "(?>^|\\G)(%)(TAG)(?>([\t ]++)((!)(?>[0-9A-Za-z-]*+(!))?+))?+",
"end": "$",
"beginCaptures": {
"1": {
"name": "punctuation.definition.directive.begin.yaml"
},
"2": {
"name": "keyword.other.directive.tag.yaml"
},
"3": {
"name": "punctuation.whitespace.separator.yaml"
},
"4": {
"name": "storage.type.tag-handle.yaml"
},
"5": {
"name": "punctuation.definition.tag.begin.yaml"
},
"6": {
"name": "punctuation.definition.tag.end.yaml"
},
"comment": "https://yaml.org/spec/1.2.2/#rule-c-tag-handle"
},
"patterns": [
{
"comment": "technically the beginning should only validate against a valid uri scheme [A-Za-z][A-Za-z0-9.+-]*",
"begin": "\\G[\t ]++(?!#)",
"end": "(?=[\r\n\t ])",
"beginCaptures": {
"0": {
"name": "punctuation.whitespace.separator.yaml"
}
},
"contentName": "support.type.tag-prefix.yaml",
"patterns": [
{
"match": "%[0-9a-fA-F]{2}",
"name": "constant.character.escape.unicode.8-bit.yaml"
},
{
"match": "%[^\r\n\t ]{2,0}",
"name": "invalid.illegal.constant.character.escape.unicode.8-bit.yaml"
},
{
"match": "\\G[,\\[\\]{}]",
"name": "invalid.illegal.character.uri.yaml"
},
{
"include": "source.yaml#non-printable"
},
{
"match": "[^\r\n\t a-zA-Z0-9-#;/?:@&=+$,_.!~*'()\\[\\]]++",
"name": "invalid.illegal.unrecognized.yaml"
}
]
},
{
"include": "#presentation-detail"
}
]
},
{
"comment": "https://yaml.org/spec/1.2.2/#rule-ns-reserved-directive",
"begin": "(?>^|\\G)(%)([\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)",
"end": "$",
"beginCaptures": {
"1": {
"name": "punctuation.definition.directive.begin.yaml"
},
"2": {
"name": "keyword.other.directive.other.yaml"
}
},
"patterns": [
{
"match": "\\G([\t ]++)([\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)",
"captures": {
"1": {
"name": "punctuation.whitespace.separator.yaml"
},
"2": {
"name": "string.unquoted.directive-name.yaml"
}
}
},
{
"match": "([\t ]++)([\\x{85}[^ \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)",
"captures": {
"1": {
"name": "punctuation.whitespace.separator.yaml"
},
"2": {
"name": "string.unquoted.directive-parameter.yaml"
}
}
},
{
"include": "#presentation-detail"
}
]
}
]
},
"document": {
"comment": "https://yaml.org/spec/1.2.2/#91-documents",
"patterns": [
{
"match": "(?>^|\\G)---(?=[\r\n\t ])",
"name": "entity.other.document.begin.yaml"
},
{
"begin": "(?>^|\\G)\\.{3}(?=[\r\n\t ])",
"end": "$",
"name": "entity.other.document.end.yaml",
"patterns": [
{
"include": "#presentation-detail"
},
{
"include": "source.yaml.1.2#unknown"
}
]
}
]
},
"block-mapping": {
"//": "The check for plain keys is expensive",
"begin": "(?<=^|\\G|\t| )(?<![^\t ][\t ]*+:[\t ]*+|^---[\t ]*+)(?!:[\r\n\t ])(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^}]++|}[ \t]*+(?!:[\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^]]++|][ \t]*+(?!:[\r\n\t ]))++]|(?#Plain)(?>[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))(?>[^:#]++|:(?![\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\r\n\t ])",
"end": "(?=:[\r\n\t ])",
"endCaptures": {
"0": {
"name": "punctuation.separator.map.value.yaml"
}
},
"name": "meta.map.yaml",
"patterns": [
{
"include": "source.yaml.1.2#block-map-key-double"
},
{
"include": "source.yaml#block-map-key-single"
},
{
"include": "source.yaml.1.2#block-map-key-plain"
},
{
"include": "source.yaml.1.2#flow-mapping"
},
{
"include": "source.yaml.1.2#flow-sequence"
}
]
},
"block-sequence": {
"comment": "https://yaml.org/spec/1.2.2/#rule-l+block-sequence",
"match": "(?<![^\t ][\t ]*+: *+|^--- *+)-(?=[\r\n\t ])",
"name": "punctuation.definition.block.sequence.item.yaml"
},
"block-map-key-explicit": {
"comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-explicit-key",
"begin": "\\?(?=[\r\n\t ])",
"end": "(?=(?>:|(?>^|\\G)(?>\\.{3}|---))[\r\n\t ])",
"beginCaptures": {
"0": {
"name": "punctuation.definition.map.key.yaml"
}
},
"endCaptures": {
"0": {
"name": "punctuation.separator.map.value.yaml"
}
},
"name": "meta.map.explicit.yaml",
"patterns": [
{
"include": "source.yaml.1.2#key-double"
},
{
"include": "source.yaml#key-single"
},
{
"include": "#flow-key-plain-out"
},
{
"include": "#block-sequence"
},
{
"include": "#block-mapping"
},
{
"include": "#block-scalar"
},
{
"include": "source.yaml.1.2#anchor-property"
},
{
"include": "source.yaml.1.2#tag-property"
},
{
"include": "#alias"
},
{
"include": "source.yaml.1.2#flow-mapping"
},
{
"include": "source.yaml.1.2#flow-sequence"
},
{
"include": "#presentation-detail"
}
]
},
"block-map-value": {
"comment": "https://yaml.org/spec/1.2.2/#rule-c-l-block-map-implicit-value",
"match": ":(?=[\r\n\t ])",
"name": "punctuation.separator.map.value.yaml"
},
"block-scalar": {
"patterns": [
{
"comment": "This doesn't work correctly when indented. Might have to dump it",
"begin": "(?>(\\|)|(>))(?<chomp>[+-])?+([1-9])(?(<chomp>)|\\g<chomp>)?+",
"while": "(?>^|\\G)(?> {\\4}| *+$)",
"beginCaptures": {
"1": {
"name": "keyword.control.flow.block-scalar.literal.yaml"
},
"2": {
"name": "keyword.control.flow.block-scalar.folded.yaml"
},
"3": {
"name": "storage.modifier.chomping-indicator.yaml"
},
"4": {
"name": "constant.numeric.indentation-indicator.yaml"
}
},
"whileCaptures": {
"0": {
"name": "punctuation.whitespace.indentation.yaml"
}
},
"name": "meta.scalar.yaml",
"patterns": [
{
"begin": "$",
"while": "\\G",
"contentName": "string.unquoted.block.yaml",
"patterns": [
{
"include": "source.yaml#non-printable"
}
]
},
{
"begin": "\\G",
"end": "$",
"patterns": [
{
"include": "#presentation-detail"
},
{
"include": "source.yaml.1.2#unknown"
}
]
}
]
},
{
"comment": "I'm not sure how I feel about this",
"begin": "(?>(\\|)|(>))([+-]?+)(.*+)",
"end": "(?! |$)",
"beginCaptures": {
"1": {
"name": "keyword.control.flow.block-scalar.literal.yaml"
},
"2": {
"name": "keyword.control.flow.block-scalar.folded.yaml"
},
"3": {
"name": "storage.modifier.chomping-indicator.yaml"
},
"4": {
"patterns": [
{
"include": "#presentation-detail"
},
{
"include": "source.yaml.1.2#unknown"
}
]
}
},
"name": "meta.scalar.yaml",
"patterns": [
{
"comment": "https://yaml.org/spec/1.2.2/#rule-l-nb-literal-text",
"//": "Find the highest indented line",
"begin": "(?>^|\\G)(?=( ++)$)",
"end": "(?>^|\\G)(?>(?=\\1(?!$))|(?!\\1| *+$) *+)",
"endCaptures": {
"0": {
"name": "punctuation.whitespace.separator.yaml"
}
},
"patterns": [
{
"include": "#presentation-detail"
}
]
},
{
"comment": "https://yaml.org/spec/1.2.2/#rule-l-nb-literal-text",
"begin": "(?>^|\\G)(?=( ++))",
"end": "(?>^|\\G)(?!\\1| *+$) *+",
"endCaptures": {
"0": {
"name": "punctuation.whitespace.separator.yaml"
}
},
"contentName": "string.unquoted.block.yaml",
"patterns": [
{
"comment": "This is not 100% correct",
"match": "(?>^|\\G) ++",
"name": "punctuation.whitespace.separator.yaml"
},
{
"include": "source.yaml#non-printable"
}
]
}
]
}
]
},
"block-plain-out": {
"comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-multi-line (FLOW-OUT)",
"begin": "(?=[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))",
"end": "(?=[\t ]++#|[\t ]*+$)",
"name": "string.unquoted.plain.out.yaml",
"patterns": [
{
"include": "source.yaml.1.2#tag-implicit-plain-out"
},
{
"match": ":(?=[\r\n\t ])",
"name": "invalid.illegal.multiline-key.yaml"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{
"include": "source.yaml#non-printable"
}
]
},
"flow-key-plain-out": {
"comment": "https://yaml.org/spec/1.2.2/#rule-ns-plain-one-line (FLOW-OUT)",
"begin": "(?=[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))",
"end": "(?=[\t ]*+(?>$|:[\r\n\t ])|[\t ]++#)",
"name": "meta.map.key.yaml string.unquoted.plain.yaml entity.name.tag.yaml",
"patterns": [
{
"include": "source.yaml.1.2#tag-implicit-plain-out"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{
"include": "source.yaml#non-printable"
}
]
},
"alias": {
"match": "(\\*)([\\x{85}[^ ,\\[\\]{}\\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]++)|(\\*)",
"captures": {
"0": {
"name": "keyword.control.flow.alias.yaml"
},
"1": {
"name": "punctuation.definition.alias.yaml"
},
"2": {
"name": "variable.other.alias.yaml"
},
"3": {
"name": "invalid.illegal.flow.alias.yaml"
}
}
},
"presentation-detail": {
"patterns": [
{
"match": "[\t ]++",
"name": "punctuation.whitespace.separator.yaml"
},
{
"include": "source.yaml#non-printable"
},
{
"include": "source.yaml.1.2#comment"
}
]
}
}
}

View File

@@ -1,621 +1,116 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/textmate/yaml.tmbundle/blob/master/Syntaxes/YAML.tmLanguage",
"This file has been converted from https://github.com/RedCMD/YAML-Syntax-Highlighter/blob/master/syntaxes/yaml.tmLanguage.json",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/textmate/yaml.tmbundle/commit/e54ceae3b719506dba7e481a77cea4a8b576ae46",
"name": "YAML",
"version": "https://github.com/RedCMD/YAML-Syntax-Highlighter/commit/c42cf86959ba238dc8a825bdd07bed6f5e97c978",
"name": "YAML Ain't Markup Language",
"scopeName": "source.yaml",
"patterns": [
{
"include": "#comment"
"comment": "Default to YAML version 1.2",
"begin": "\\A",
"while": "^",
"patterns": [
{
"include": "source.yaml.1.2"
}
]
},
{
"include": "#property"
"comment": "Support legacy FrontMatter integration",
"//": "https://github.com/microsoft/vscode-markdown-tm-grammar/pull/162",
"begin": "(?<=^-{3,}\\s*+)\\G$",
"while": "^(?! {3,0}-{3,}[ \t]*+$|[ \t]*+\\.{3}$)",
"patterns": [
{
"include": "source.yaml.1.2"
}
]
},
{
"include": "#directive"
},
{
"match": "^---",
"name": "entity.other.document.begin.yaml"
},
{
"match": "^\\.{3}",
"name": "entity.other.document.end.yaml"
},
{
"include": "#node"
"comment": "Basic version for embedding",
"include": "source.yaml.embedded"
}
],
"repository": {
"block-collection": {
"patterns": [
{
"include": "#block-sequence"
},
{
"include": "#block-mapping"
}
]
"parity": {
"comment": "Yes... That is right. Due to the changes with \\x2028, \\x2029, \\x85 and 'tags'. This is all the code I was able to reuse between all YAML versions 1.3, 1.2, 1.1 and 1.0"
},
"block-mapping": {
"patterns": [
{
"include": "#block-pair"
}
]
},
"block-node": {
"patterns": [
{
"include": "#prototype"
},
{
"include": "#block-scalar"
},
{
"include": "#block-collection"
},
{
"include": "#flow-scalar-plain-out"
},
{
"include": "#flow-node"
}
]
},
"block-pair": {
"patterns": [
{
"begin": "\\?",
"beginCaptures": {
"1": {
"name": "punctuation.definition.key-value.begin.yaml"
}
},
"end": "(?=\\?)|^ *(:)|(:)",
"endCaptures": {
"1": {
"name": "punctuation.separator.key-value.mapping.yaml"
},
"2": {
"name": "invalid.illegal.expected-newline.yaml"
}
},
"name": "meta.block-mapping.yaml",
"patterns": [
{
"include": "#block-node"
}
]
},
{
"begin": "(?x)\n (?=\n (?x:\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n )\n (\n [^\\s:]\n | : \\S\n | \\s+ (?![#\\s])\n )*\n \\s*\n :\n\t\t\t\t\t\t\t(\\s|$)\n )\n ",
"end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n ",
"patterns": [
{
"include": "#flow-scalar-plain-out-implicit-type"
},
{
"begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n ",
"beginCaptures": {
"0": {
"name": "entity.name.tag.yaml"
}
},
"contentName": "entity.name.tag.yaml",
"end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n ",
"name": "string.unquoted.plain.out.yaml"
}
]
},
{
"match": ":(?=\\s|$)",
"name": "punctuation.separator.key-value.mapping.yaml"
}
]
},
"block-scalar": {
"begin": "(?:(\\|)|(>))([1-9])?([-+])?(.*\\n?)",
"beginCaptures": {
"1": {
"name": "keyword.control.flow.block-scalar.literal.yaml"
},
"2": {
"name": "keyword.control.flow.block-scalar.folded.yaml"
},
"3": {
"name": "constant.numeric.indentation-indicator.yaml"
},
"4": {
"name": "storage.modifier.chomping-indicator.yaml"
},
"5": {
"patterns": [
{
"include": "#comment"
},
{
"match": ".+",
"name": "invalid.illegal.expected-comment-or-newline.yaml"
}
]
}
},
"end": "^(?=\\S)|(?!\\G)",
"patterns": [
{
"begin": "^([ ]+)(?! )",
"end": "^(?!\\1|\\s*$)",
"name": "string.unquoted.block.yaml"
}
]
},
"block-sequence": {
"match": "(-)(?!\\S)",
"name": "punctuation.definition.block.sequence.item.yaml"
},
"comment": {
"begin": "(?:(^[ \\t]*)|[ \\t]+)(?=#\\p{Print}*$)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.yaml"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.yaml"
}
},
"end": "\\n",
"name": "comment.line.number-sign.yaml"
}
]
},
"directive": {
"begin": "^%",
"beginCaptures": {
"0": {
"name": "punctuation.definition.directive.begin.yaml"
}
},
"end": "(?=$|[ \\t]+($|#))",
"name": "meta.directive.yaml",
"patterns": [
{
"captures": {
"1": {
"name": "keyword.other.directive.yaml.yaml"
},
"2": {
"name": "constant.numeric.yaml-version.yaml"
}
},
"match": "\\G(YAML)[ \\t]+(\\d+\\.\\d+)"
},
{
"captures": {
"1": {
"name": "keyword.other.directive.tag.yaml"
},
"2": {
"name": "storage.type.tag-handle.yaml"
},
"3": {
"name": "support.type.tag-prefix.yaml"
}
},
"match": "(?x)\n \\G\n (TAG)\n (?:[ \\t]+\n ((?:!(?:[0-9A-Za-z\\-]*!)?))\n (?:[ \\t]+ (\n ! (?x: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )*\n | (?![,!\\[\\]{}]) (?x: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )+\n )\n )?\n )?\n "
},
{
"captures": {
"1": {
"name": "support.other.directive.reserved.yaml"
},
"2": {
"name": "string.unquoted.directive-name.yaml"
},
"3": {
"name": "string.unquoted.directive-parameter.yaml"
}
},
"match": "(?x) \\G (\\w+) (?:[ \\t]+ (\\w+) (?:[ \\t]+ (\\w+))? )?"
},
{
"match": "\\S+",
"name": "invalid.illegal.unrecognized.yaml"
}
]
},
"flow-alias": {
"captures": {
"1": {
"name": "keyword.control.flow.alias.yaml"
},
"2": {
"name": "punctuation.definition.alias.yaml"
},
"3": {
"name": "variable.other.alias.yaml"
},
"4": {
"name": "invalid.illegal.character.anchor.yaml"
}
},
"match": "((\\*))([^\\s\\[\\]/{/},]+)([^\\s\\]},]\\S*)?"
},
"flow-collection": {
"patterns": [
{
"include": "#flow-sequence"
},
{
"include": "#flow-mapping"
}
]
},
"flow-mapping": {
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.mapping.begin.yaml"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.mapping.end.yaml"
}
},
"name": "meta.flow-mapping.yaml",
"patterns": [
{
"include": "#prototype"
},
{
"match": ",",
"name": "punctuation.separator.mapping.yaml"
},
{
"include": "#flow-pair"
}
]
},
"flow-node": {
"patterns": [
{
"include": "#prototype"
},
{
"include": "#flow-alias"
},
{
"include": "#flow-collection"
},
{
"include": "#flow-scalar"
}
]
},
"flow-pair": {
"patterns": [
{
"begin": "\\?",
"beginCaptures": {
"0": {
"name": "punctuation.definition.key-value.begin.yaml"
}
},
"end": "(?=[},\\]])",
"name": "meta.flow-pair.explicit.yaml",
"patterns": [
{
"include": "#prototype"
},
{
"include": "#flow-pair"
},
{
"include": "#flow-node"
},
{
"begin": ":(?=\\s|$|[\\[\\]{},])",
"beginCaptures": {
"0": {
"name": "punctuation.separator.key-value.mapping.yaml"
}
},
"end": "(?=[},\\]])",
"patterns": [
{
"include": "#flow-value"
}
]
}
]
},
{
"begin": "(?x)\n (?=\n (?:\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n )\n (\n [^\\s:[\\[\\]{},]]\n | : [^\\s[\\[\\]{},]]\n | \\s+ (?![#\\s])\n )*\n \\s*\n :\n\t\t\t\t\t\t\t(\\s|$)\n )\n ",
"end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n ",
"name": "meta.flow-pair.key.yaml",
"patterns": [
{
"include": "#flow-scalar-plain-in-implicit-type"
},
{
"begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n ",
"beginCaptures": {
"0": {
"name": "entity.name.tag.yaml"
}
},
"contentName": "entity.name.tag.yaml",
"end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n ",
"name": "string.unquoted.plain.in.yaml"
}
]
},
{
"include": "#flow-node"
},
{
"begin": ":(?=\\s|$|[\\[\\]{},])",
"captures": {
"0": {
"name": "punctuation.separator.key-value.mapping.yaml"
}
},
"end": "(?=[},\\]])",
"name": "meta.flow-pair.yaml",
"patterns": [
{
"include": "#flow-value"
}
]
}
]
},
"flow-scalar": {
"patterns": [
{
"include": "#flow-scalar-double-quoted"
},
{
"include": "#flow-scalar-single-quoted"
},
{
"include": "#flow-scalar-plain-in"
}
]
},
"flow-scalar-double-quoted": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.yaml"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.yaml"
}
},
"name": "string.quoted.double.yaml",
"patterns": [
{
"match": "\\\\([0abtnvfre \"/\\\\N_Lp]|x\\d\\d|u\\d{4}|U\\d{8})",
"name": "constant.character.escape.yaml"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.double-quoted.newline.yaml"
}
]
},
"flow-scalar-plain-in": {
"patterns": [
{
"include": "#flow-scalar-plain-in-implicit-type"
},
{
"begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n ",
"end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n ",
"name": "string.unquoted.plain.in.yaml"
}
]
},
"flow-scalar-plain-in-implicit-type": {
"patterns": [
{
"captures": {
"1": {
"name": "constant.language.null.yaml"
},
"2": {
"name": "constant.language.boolean.yaml"
},
"3": {
"name": "constant.numeric.integer.yaml"
},
"4": {
"name": "constant.numeric.float.yaml"
},
"5": {
"name": "constant.other.timestamp.yaml"
},
"6": {
"name": "constant.language.value.yaml"
},
"7": {
"name": "constant.language.merge.yaml"
}
},
"match": "(?x)\n (?x:\n (null|Null|NULL|~)\n | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\n | (\n (?:\n [-+]? 0b [0-1_]+ # (base 2)\n | [-+]? 0 [0-7_]+ # (base 8)\n | [-+]? (?: 0|[1-9][0-9_]*) # (base 10)\n | [-+]? 0x [0-9a-fA-F_]+ # (base 16)\n | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60)\n )\n )\n | (\n (?x:\n [-+]? (?: [0-9] [0-9_]*)? \\. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10)\n | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \\. [0-9_]* # (base 60)\n | [-+]? \\. (?: inf|Inf|INF) # (infinity)\n | \\. (?: nan|NaN|NAN) # (not a number)\n )\n )\n | (\n (?x:\n \\d{4} - \\d{2} - \\d{2} # (y-m-d)\n | \\d{4} # (year)\n - \\d{1,2} # (month)\n - \\d{1,2} # (day)\n (?: [Tt] | [ \\t]+) \\d{1,2} # (hour)\n : \\d{2} # (minute)\n : \\d{2} # (second)\n (?: \\.\\d*)? # (fraction)\n (?:\n (?:[ \\t]*) Z\n | [-+] \\d{1,2} (?: :\\d{1,2})?\n )? # (time zone)\n )\n )\n | (=)\n | (<<)\n )\n (?:\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n | \\s* : [\\[\\]{},]\n | \\s* [\\[\\]{},]\n )\n )\n "
}
]
},
"flow-scalar-plain-out": {
"patterns": [
{
"include": "#flow-scalar-plain-out-implicit-type"
},
{
"begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n ",
"end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n ",
"name": "string.unquoted.plain.out.yaml"
}
]
},
"flow-scalar-plain-out-implicit-type": {
"patterns": [
{
"captures": {
"1": {
"name": "constant.language.null.yaml"
},
"2": {
"name": "constant.language.boolean.yaml"
},
"3": {
"name": "constant.numeric.integer.yaml"
},
"4": {
"name": "constant.numeric.float.yaml"
},
"5": {
"name": "constant.other.timestamp.yaml"
},
"6": {
"name": "constant.language.value.yaml"
},
"7": {
"name": "constant.language.merge.yaml"
}
},
"match": "(?x)\n (?x:\n (null|Null|NULL|~)\n | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\n | (\n (?:\n [-+]? 0b [0-1_]+ # (base 2)\n | [-+]? 0 [0-7_]+ # (base 8)\n | [-+]? (?: 0|[1-9][0-9_]*) # (base 10)\n | [-+]? 0x [0-9a-fA-F_]+ # (base 16)\n | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60)\n )\n )\n | (\n (?x:\n [-+]? (?: [0-9] [0-9_]*)? \\. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10)\n | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \\. [0-9_]* # (base 60)\n | [-+]? \\. (?: inf|Inf|INF) # (infinity)\n | \\. (?: nan|NaN|NAN) # (not a number)\n )\n )\n | (\n (?x:\n \\d{4} - \\d{2} - \\d{2} # (y-m-d)\n | \\d{4} # (year)\n - \\d{1,2} # (month)\n - \\d{1,2} # (day)\n (?: [Tt] | [ \\t]+) \\d{1,2} # (hour)\n : \\d{2} # (minute)\n : \\d{2} # (second)\n (?: \\.\\d*)? # (fraction)\n (?:\n (?:[ \\t]*) Z\n | [-+] \\d{1,2} (?: :\\d{1,2})?\n )? # (time zone)\n )\n )\n | (=)\n | (<<)\n )\n (?x:\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : (\\s|$)\n )\n )\n "
}
]
},
"flow-scalar-single-quoted": {
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.yaml"
}
},
"block-map-key-single": {
"comment": "https://yaml.org/spec/1.2.2/#rule-c-single-quoted (BLOCK-KEY)",
"begin": "\\G'",
"end": "'(?!')",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.yaml"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.yaml"
}
},
"name": "string.quoted.single.yaml",
"name": "meta.map.key.yaml string.quoted.single.yaml entity.name.tag.yaml",
"patterns": [
{
"match": ".[\t ]*+$",
"name": "invalid.illegal.multiline-key.yaml"
},
{
"match": "[^\t -\\x{10FFFF}]++",
"name": "invalid.illegal.character.yaml"
},
{
"match": "''",
"name": "constant.character.escape.single-quoted.yaml"
"name": "constant.character.escape.single-quote.yaml"
}
]
},
"flow-sequence": {
"begin": "\\[",
"key-single": {
"comment": "https://yaml.org/spec/1.2.2/#rule-c-single-quoted (FLOW-OUT)",
"begin": "'",
"end": "'(?!')",
"beginCaptures": {
"0": {
"name": "punctuation.definition.sequence.begin.yaml"
"name": "punctuation.definition.string.begin.yaml"
}
},
"end": "\\]",
"endCaptures": {
"0": {
"name": "punctuation.definition.sequence.end.yaml"
"name": "punctuation.definition.string.end.yaml"
}
},
"name": "meta.flow-sequence.yaml",
"name": "meta.map.key.yaml string.quoted.single.yaml entity.name.tag.yaml",
"patterns": [
{
"include": "#prototype"
"match": "[^\r\n\t -\\x{10FFFF}]++",
"name": "invalid.illegal.character.yaml"
},
{
"match": ",",
"name": "punctuation.separator.sequence.yaml"
},
{
"include": "#flow-pair"
},
{
"include": "#flow-node"
"match": "''",
"name": "constant.character.escape.single-quote.yaml"
}
]
},
"flow-value": {
"patterns": [
{
"begin": "\\G(?![},\\]])",
"end": "(?=[},\\]])",
"name": "meta.flow-pair.value.yaml",
"patterns": [
{
"include": "#flow-node"
}
]
}
]
},
"node": {
"patterns": [
{
"include": "#block-node"
}
]
},
"property": {
"begin": "(?=!|&)",
"end": "(?!\\G)",
"name": "meta.property.yaml",
"patterns": [
{
"captures": {
"1": {
"name": "keyword.control.property.anchor.yaml"
},
"2": {
"name": "punctuation.definition.anchor.yaml"
},
"3": {
"name": "entity.name.type.anchor.yaml"
},
"4": {
"name": "invalid.illegal.character.anchor.yaml"
}
},
"match": "\\G((&))([^\\s\\[\\]/{/},]+)(\\S+)?"
},
{
"match": "(?x)\n \\G\n (?:\n ! < (?: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )+ >\n | (?:!(?:[0-9A-Za-z\\-]*!)?) (?: %[0-9A-Fa-f]{2} | [0-9A-Za-z\\-#;/?:@&=+$_.~*'()] )+\n | !\n )\n (?=\\ |\\t|$)\n ",
"name": "storage.type.tag-handle.yaml"
},
{
"match": "\\S+",
"name": "invalid.illegal.tag-handle.yaml"
}
]
},
"prototype": {
"patterns": [
{
"include": "#comment"
},
{
"include": "#property"
}
]
"non-printable": {
"//": {
"85": "…",
"2028": "",
"2029": "",
"10000": "𐀀",
"A0": " ",
"D7FF": "퟿",
"E000": "",
"FFFD": "<22>",
"FEFF": "",
"FFFF": "￿",
"10FFFF": "􏿿"
},
"//match": "[\\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}&&[^\t\n\r\\x{85}]]++",
"match": "[^\t\n\r -~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}]++",
"name": "invalid.illegal.non-printable.yaml"
}
}
}