{ "name": "editorconfig", "scopeName": "source.editorconfig", "patterns": [ { "include": "#main" } ], "repository": { "comment": { "patterns": [ { "name": "comment.line.number-sign.editorconfig", "begin": "(\\s*)(#)", "end": "$", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.editorconfig" }, "2": { "name": "punctuation.definition.comment.editorconfig" } } }, { "name": "comment.line.semicolon.editorconfig", "begin": "(\\s*)(;)", "end": "$", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.editorconfig" }, "2": { "name": "punctuation.definition.comment.editorconfig" } } } ] }, "escape": { "name": "constant.character.escape.editorconfig", "match": "\\\\." }, "keywords": { "patterns": [ { "name": "constant.language.boolean.${1:/downcase}.editorconfig", "match": "(?i)\\b(true|false|on|off|yes|no)\\b" }, { "name": "constant.language.charset.encoding.${1:/downcase}.editorconfig", "match": "(?i)\\b(latin1|utf-8|utf-16[bl]e)\\b" }, { "name": "constant.language.${1:/downcase}.editorconfig", "match": "(?i)\\b(CRLF|CR|LF|tab|space|unset)\\b" } ] }, "main": { "patterns": [ { "include": "#comment" }, { "include": "#section" }, { "include": "#rule" } ] }, "number": { "name": "constant.numeric.decimal.integer.int.editorconfig", "match": "\\d+" }, "pathBracketsCurly": { "begin": "{", "end": "}|(?=$)", "patterns": [ { "include": "#escape" }, { "name": "punctuation.separator.delimiter.comma.editorconfig", "match": "," }, { "include": "#pathRange" }, { "include": "#pathSpec" } ], "beginCaptures": { "0": { "name": "punctuation.definition.brace.bracket.curly.begin.editorconfig" } }, "endCaptures": { "0": { "name": "punctuation.definition.brace.bracket.curly.end.editorconfig" } } }, "pathBracketsSquare": { "begin": "\\[", "end": "\\]|(?=$)", "patterns": [ { "include": "#pathSpec" } ], "beginCaptures": { "0": { "name": "punctuation.definition.brace.bracket.square.begin.editorconfig" } }, "endCaptures": { "0": { "name": "punctuation.definition.brace.bracket.square.end.editorconfig" } } }, "pathRange": { "name": "meta.range.editorconfig", "match": "([0-9]+)(\\.{2})([0-9]+)", "captures": { "1": { "patterns": [ { "include": "#number" } ] }, "2": { "name": "punctuation.definition.separator.range.editorconfig" }, "3": { "patterns": [ { "include": "#number" } ] } } }, "pathSpec": { "patterns": [ { "include": "#escape" }, { "include": "#pathBracketsCurly" }, { "include": "#pathBracketsSquare" }, { "name": "keyword.operator.glob.wildcard.globstar.editorconfig", "match": "\\*{2}" }, { "name": "keyword.operator.glob.wildcard.editorconfig", "match": "\\*" }, { "name": "keyword.operator.glob.wildcard.editorconfig", "match": "\\?" } ] }, "rule": { "patterns": [ { "match": "^\\s*(indent_(width))(?=$|[=\\s])", "captures": { "1": { "name": "keyword.other.definition.indent_size.editorconfig" }, "2": { "name": "invalid.illegal.confusable.editorconfig" } } }, { "match": "^\\s*(tab_(size))(?=$|[=\\s])", "captures": { "1": { "name": "keyword.other.definition.tab_width.editorconfig" }, "2": { "name": "invalid.illegal.confusable.editorconfig" } } }, { "name": "meta.rule.${1:/downcase}.editorconfig", "begin": "^\\s*([A-Za-z0-9_]+)\\s*(=)", "end": "$", "patterns": [ { "include": "#value" } ], "beginCaptures": { "1": { "name": "keyword.other.definition.${1:/downcase}.editorconfig" }, "2": { "name": "punctuation.separator.key-value.editorconfig" } } } ] }, "section": { "name": "meta.section.editorconfig", "begin": "^\\s*(?=\\[.*?\\])", "end": "(?!\\G)(?=^\\s*\\[)", "patterns": [ { "include": "#sectionHeader" }, { "include": "#comment" }, { "include": "#rule" } ] }, "sectionHeader": { "name": "meta.section.header.editorconfig", "contentName": "entity.name.section.group-title.editorconfig", "begin": "\\G\\[", "end": "\\]|(?=$)", "patterns": [ { "name": "keyword.control.logical.not.negation.editorconfig", "match": "\\G!" }, { "include": "#pathSpec" } ], "beginCaptures": { "0": { "name": "punctuation.section.brace.bracket.square.begin.editorconfig" } }, "endCaptures": { "0": { "name": "punctuation.section.brace.bracket.square.end.editorconfig" } } }, "string": { "patterns": [ { "name": "string.quoted.double.editorconfig", "begin": "\"", "end": "\"", "patterns": [ { "include": "#escape" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.editorconfig" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.editorconfig" } } }, { "name": "string.quoted.single.editorconfig", "begin": "'", "end": "'", "patterns": [ { "include": "#escape" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.editorconfig" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.editorconfig" } } } ] }, "value": { "patterns": [ { "include": "#escape" }, { "include": "#comment" }, { "include": "#keywords" }, { "include": "#number" }, { "include": "#string" } ] } } }