{ "name": "HTTP Spec", "scopeName": "source.httpspec", "patterns": [ { "name": "meta.request.httpspec", "patterns": [ { "include": "#request" }, { "match": "^$" }, { "include": "#response" } ] } ], "repository": { "ampersand": { "patterns": [ { "name": "support.function.ampersand.httpspec", "match": "(?\u003c!\\\u0026)\\\u0026(?!\\\u0026)" } ] }, "closingbracket": { "patterns": [ { "name": "keyword.other.multiplexend.httpspec" }, { "match": "\\]" } ] }, "comma": { "patterns": [ { "name": "keyword.other.comma.httpspec.test", "match": "\\," } ] }, "emptyline": { "patterns": [ { "match": "^\\s*$" } ] }, "equals": { "patterns": [ { "name": "support.function.keyvaluepairseparator.httpspec", "match": "\\=" } ] }, "header": { "patterns": [ { "name": "string.unquoted.uri.httpspec", "match": "^([a-zA-Z\\-_]+\\:)\\s(.*)$", "captures": { "1": { "name": "variable.parameter.headername.httpspec" } } } ] }, "invalidcomma": { "patterns": [ { "name": "invalid.illegal.comma.httpspec", "match": "^\\,|\\,(?=\\s)" } ] }, "jsonblock": { "patterns": [ { "include": "source.json" } ] }, "methodlist": { "patterns": [ { "include": "#methodname" }, { "include": "#invalidcomma" }, { "include": "#comma" } ] }, "methodname": { "patterns": [ { "name": "keyword.other.method.httpspec", "match": "(?:\\b)(OPTIONS|HEAD|GET|DELETE|PUT|PATCH|POST)" } ] }, "multiplex": { "begin": "(\\[)", "end": "\\]", "patterns": [ { "include": "#uripart" }, { "include": "#comma" } ], "beginCaptures": { "0": { "name": "keyword.other" } }, "endCaptures": { "0": { "name": "keyword.other" } } }, "namevaluepair": { "patterns": [ { "include": "#uriqueryname" }, { "include": "#equals" }, { "include": "#uriqueryvalue" } ] }, "openingbracket": { "patterns": [ { "name": "keyword.other.multiplexstart.httpspec", "match": "\\[" } ] }, "questionmark": { "patterns": [ { "name": "support.function.queryseparator.httpspec", "match": "\\?" } ] }, "request": { "patterns": [ { "begin": "^(?=OPTIONS|HEAD|GET|DELETE|PUT|PATCH|POST)", "end": "^(?=\\d\\d\\d)", "patterns": [ { "include": "#requestline" }, { "include": "#header" }, { "include": "#jsonblock" } ] } ] }, "requestline": { "patterns": [ { "include": "#methodlist" }, { "include": "#uri" } ] }, "response": { "patterns": [ { "include": "#statusline" }, { "include": "#header" }, { "include": "#jsonblock" } ] }, "statusline": { "patterns": [ { "match": "^(\\d\\d\\d)\\s(.*)$", "captures": { "0": { "name": "constant.language.statustext.httpspec" } } } ] }, "uri": { "patterns": [ { "include": "#uripath" }, { "include": "#multiplex" }, { "include": "#questionmark" }, { "include": "#uriquery" } ] }, "uripart": { "patterns": [ { "match": "([a-bA-B0-9\\-_/]+)" } ] }, "uripath": { "patterns": [ { "name": "support.function.httpspec", "begin": "(?:\\s)\\/", "end": "(?:$)", "patterns": [ { "include": "#uripart" }, { "include": "#multiplex" } ] } ] }, "uriquery": { "patterns": [ { "include": "#namevaluepair" }, { "include": "#ampersand" } ] }, "uriqueryname": { "patterns": [ { "name": "support.function.uriqueryname.httpspec", "match": "(?\u003c=[?\u0026])([^=\u0026])+" } ] }, "uriqueryvalue": { "patterns": [ { "name": "support.function.uriqueryvalue.httpspec", "match": "(?\u003c=\\=)([^=\u0026]+)" } ] } } }