{"name":"Thrift","scopeName":"source.thrift","patterns":[{"include":"#comments"},{"name":"meta.include.thrift","match":"(?\u003c!\\S)(include)(?!\\S)(?:\\s+((['\"])(?\u003e.*?(\\3))))?","captures":{"1":{"name":"keyword.other.include.thrift"},"2":{"name":"string.quoted.thrift"},"3":{"name":"punctuation.definition.string.begin.thrift"},"4":{"name":"punctuation.definition.string.end.thrift"}}},{"name":"meta.cpp-include.thrift","match":"(?\u003c!\\S)(cpp_include)(?!\\S)(?:\\s+((['\"])(?\u003e.*?(\\3))))?","captures":{"1":{"name":"keyword.other.cpp-include.thrift"},"2":{"name":"string.quoted.thrift"},"3":{"name":"punctuation.definition.string.begin.thrift"},"4":{"name":"punctuation.definition.string.end.thrift"}}},{"name":"meta.namespace.thrift","match":"(?\u003c!\\S)(namespace)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*)(?:\\s+([a-zA-Z_][\\w.]*))?)?","captures":{"1":{"name":"keyword.other.namespace.thrift"},"2":{"name":"support.other.namespace-language.thrift"},"3":{"name":"variable.other.namespace.thrift"}}},{"name":"meta.namespace.thrift","match":"(?\u003c!\\S)((?:php|xsd)_namespace)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*))?","captures":{"1":{"name":"keyword.other.namespace.thrift"},"2":{"name":"variable.other.namespace.thrift"}}},{"match":"(?\u003c!\\S)((?:cpp|ruby|csharp)_namespace|py_module|(?:java|perl)_package|smalltalk_(?:category|prefix)|cocoa_prefix)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*))?","captures":{"1":{"name":"invalid.deprecated.namespace.thrift"},"2":{"name":"variable.other.namespace.thrift"}}},{"begin":"(?=(struct|s?enum|union|service|const|typedef|exception)\\b)","end":"(?x)$.^ # this regex should never end","patterns":[{"include":"#comments"},{"name":"meta.const.thrift","begin":"(?\u003c!\\S)(const)(?!\\S)(?:\\s+(?\u003cft\u003emap\\s*\u003c\\s*\\g\u003cft\u003e\\s*,\\s*\\g\u003cft\u003e\\s*\u003e|set\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e|list\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e\\s*cpp_type|[a-zA-Z_][\\w.]*)(?:\\s+([a-zA-Z_][\\w.]*)(?:\\s*=)?)?)?","end":"$|^","patterns":[{"include":"#comments"},{"include":"#value"}],"beginCaptures":{"1":{"name":"keyword.other.const.thrift"},"2":{"name":"storage.type.const.thrift"},"3":{"name":"variable.other.const.thrift"}}},{"name":"meta.typedef.thrift","begin":"(?\u003c!\\S)(typedef)(?!\\S)(?:\\s+(?\u003cft\u003emap\\s*\u003c\\s*\\g\u003cft\u003e\\s*,\\s*\\g\u003cft\u003e\\s*\u003e|set\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e|list\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e\\s*cpp_type|[a-zA-Z_][\\w.]*)(?:\\s+([a-zA-Z_][\\w.]*))?)?","end":"$|^","patterns":[{"include":"#comments"}],"beginCaptures":{"1":{"name":"keyword.other.typedef.thrift"},"2":{"name":"storage.type.typedef.thrift"},"3":{"name":"variable.other.typedef.thrift"}}},{"name":"meta.union.thrift","begin":"(?\u003c!\\S)(union)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*)\\s*(?![^\\s{]))?","end":"(?\u003c=\\})|$","patterns":[{"name":"keyword.other.xsd-all.thrift","match":"(?\u003c!\\S)xsd_all(?!\\S)"},{"begin":"\\{","end":"\\}","patterns":[{"include":"#comments"},{"include":"#field"}],"beginCaptures":{"0":{"name":"punctuation.section.union.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.section.union.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.union.thrift"},"2":{"name":"entity.name.type.union.thrift"}}},{"name":"meta.enum.thrift","begin":"(?\u003c!\\S)(enum)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*)\\s*(?![^\\s{]))?","end":"(?\u003c=\\})|$","patterns":[{"begin":"\\{","end":"\\}","patterns":[{"match":"(?\u003c!\\S)([a-zA-Z_][\\w.]*)(?:\\s*=\\s*(\\d*)(?:\\s*[,;])?)?","captures":{"1":{"name":"variable.other.enum.thrift"},"2":{"name":"constant.numeric.integer.thrift"}}},{"include":"#comments"},{"name":"invalid.illegal.thrift","match":"\\S"}],"beginCaptures":{"0":{"name":"punctuation.section.enum.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.section.enum.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.enum.thrift"},"2":{"name":"entity.name.type.enum.thrift"}}},{"name":"meta.senum.thrift","begin":"(?\u003c!\\S)(senum)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*)\\s*(?![^\\s{]))?","end":"(?\u003c=\\})|$","patterns":[{"begin":"\\{","end":"\\}","patterns":[{"match":"(?\u003c!\\S)([a-zA-Z_][\\w.]*)(?:\\s*[,;])?","captures":{"1":{"name":"variable.other.senum.thrift"}}},{"include":"#comments"},{"name":"invalid.illegal.thrift","match":"\\S"}],"beginCaptures":{"0":{"name":"punctuation.section.senum.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.section.senum.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.senum.thrift"},"2":{"name":"entity.name.type.senum.thrift"}}},{"name":"meta.struct.thrift","begin":"(?\u003c!\\S)(struct)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*)\\s*(?![^\\s{]))?","end":"(?\u003c=\\})|$","patterns":[{"name":"keyword.other.xsd-all.thrift","match":"(?\u003c!\\S)xsd_all(?!\\S)"},{"begin":"\\{","end":"\\}","patterns":[{"include":"#comments"},{"include":"#field"}],"beginCaptures":{"0":{"name":"punctuation.section.struct.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.section.struct.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.struct.thrift"},"2":{"name":"entity.name.type.struct.thrift"}}},{"name":"meta.exception.thrift","begin":"(?\u003c!\\S)(exception)(?!\\S)(?:\\s+([a-zA-Z_][\\w.]*)\\s*(?![^\\s{]))?","end":"(?\u003c=\\})|$","patterns":[{"begin":"\\{","end":"\\}","patterns":[{"include":"#comments"},{"include":"#field"}],"beginCaptures":{"0":{"name":"punctuation.section.exception.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.section.exception.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.exception.thrift"},"2":{"name":"entity.name.type.exception.thrift"}}},{"name":"meta.service.thrift","begin":"(?\u003c!\\S)(service)(?!\\S)(?:\\s+([a-zA-z_][\\w.]*)(?:\\s+(extends)(?:\\s+([a-zA-Z_][\\w.]*))?)?\\s*(?![^\\s{]))?","end":"(?\u003c=\\})|$","patterns":[{"begin":"\\{","end":"\\}","patterns":[{"include":"#comments"},{"name":"meta.service.function.thrift","begin":"(?x)(?\u003c!\\S)\n\t\t\t\t\t\t\t\t\t\t\t(async(?!\\S))?\\s*\n\t\t\t\t\t\t\t\t\t\t\t(?\u003cft\u003e\n\t\t\t\t\t\t\t\t\t\t\t\tmap\\s*\u003c\\s*\\g\u003cft\u003e\\s*,\\s*\\g\u003cft\u003e\\s*\u003e |\n\t\t\t\t\t\t\t\t\t\t\t\tset\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e |\n\t\t\t\t\t\t\t\t\t\t\t\tlist\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e\\s*(cpp_type(?!\\S))? |\n\t\t\t\t\t\t\t\t\t\t\t\t(?!async\\b)[a-zA-Z_][\\w.]*\n\t\t\t\t\t\t\t\t\t\t\t)\\s*\n\t\t\t\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t\t\t\t(?\u003c!\\S)([a-zA-Z_][\\w.]*)\\s*(?![^\\s(])\n\t\t\t\t\t\t\t\t\t\t\t)?","end":"$|^","patterns":[{"begin":"\\(","end":"\\)","patterns":[{"include":"#comments"},{"include":"#field"}],"beginCaptures":{"0":{"name":"punctuation.definition.arguments.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.arguments.end.thrift"}}},{"begin":"(?\u003c![^\\s)])(throws)(?![^\\s(])","end":"$","patterns":[{"begin":"\\(","end":"\\)","patterns":[{"include":"#comments"},{"include":"#field"}],"beginCaptures":{"0":{"name":"punctuation.definition.arguments.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.arguments.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.service.function.throws.thrift"}}},{"include":"#comments"}],"beginCaptures":{"1":{"name":"keyword.other.async.thrift"},"2":{"name":"storage.type.function.thrift"},"3":{"name":"keyword.other.cpp_type.thrift"},"4":{"name":"entity.name.function.thrift"}}}],"beginCaptures":{"0":{"name":"punctuation.section.service.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.section.service.end.thrift"}}}],"beginCaptures":{"1":{"name":"keyword.other.service.thrift"},"2":{"name":"entity.name.type.service.thrift"},"3":{"name":"keyword.other.service.extends.thrift"},"4":{"name":"entity.other.inherited-class.thrift"}}}]}],"repository":{"comments":{"patterns":[{"begin":"(^[ \\t]+)?(?=#)","end":"(?!\\G)","patterns":[{"name":"comment.line.number-sign.thrift","begin":"#","end":"\\n","beginCaptures":{"0":{"name":"punctuation.definition.comment.thrift"}}}],"beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.thrift"}}},{"begin":"(^[ \\t]+)?(?=//)","end":"(?!\\G)","patterns":[{"name":"comment.line.double-slash.thrift","begin":"//","end":"\\n","beginCaptures":{"0":{"name":"punctuation.definition.comment.thrift"}}}],"beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.thrift"}}},{"name":"comment.block.documentation.thrift","begin":"/\\*\\*","end":"\\*/","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.comment.end.thrift"}}},{"name":"comment.block.thrift","begin":"/\\*","end":"\\*/","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.comment.end.thrift"}}}]},"field":{"name":"meta.field.thrift","begin":"(?x)\n\t\t\t\t\t\t(?\u003c![^\\s{(])(?=\\S)\n\t\t\t\t\t\t(\\d+\\s*:)?[ \\t]*\n\t\t\t\t\t\t(?:\t(required|optional)(?!\\S)[ \\t]*\n\t\t\t\t\t\t|\t(?=\\S)(?!=required|optional|\\d)\n\t\t\t\t\t\t)","end":"[,;]|(?=[)#]|//|/\\*)|$","patterns":[{"begin":"(?x)\n\t\t\t\t\t\t\t(?\u003cft\u003e\n\t\t\t\t\t\t\t\tmap\\s*\u003c\\s*\\g\u003cft\u003e\\s*,\\s*\\g\u003cft\u003e\\s*\u003e |\n\t\t\t\t\t\t\t\tset\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e |\n\t\t\t\t\t\t\t\tlist\\s*\u003c\\s*\\g\u003cft\u003e\\s*\u003e\\s*(cpp_type(?!\\S))? |\n\t\t\t\t\t\t\t\t[a-zA-Z_][\\w.]*\n\t\t\t\t\t\t\t)[ \\t]*\n\t\t\t\t\t\t\t(?:([a-zA-Z_][\\w.]*)[ \\t]*)? # identifier\n\t\t\t\t\t\t\t","end":"(?=[,;]|[)#]|//|/\\*)|$","patterns":[{"begin":"=","end":"(?=[,;]|[)#]|//|/\\*)|$","patterns":[{"name":"keyword.other.xsd_optional.thrift","match":"(?\u003c!\\S)(xsd_optional)\\b"},{"name":"keyword.other.xsd_nillable.thrift","match":"(?\u003c!\\S)(xsd_nillable)\\b"},{"include":"#value"}]}],"beginCaptures":{"1":{"name":"storage.type.field.thrift"},"2":{"name":"keyword.other.cpp-type.thrift"},"3":{"name":"variable.other.field-name.thrift"}}}],"beginCaptures":{"1":{"name":"entity.other.field-id.thrift"},"2":{"name":"keyword.other.requiredness.thrift"}},"endCaptures":{"0":{"name":"punctuation.separator.fields.thrift"}}},"value":{"patterns":[{"name":"constant.numeric.float.thrift","match":"[+-]?\\d*\\.\\d+([eE][+-]?\\d+)?"},{"name":"constant.numeric.integer.thrift","match":"[+-]?\\d+"},{"name":"constant.other.const-data.thrift","match":"[a-zA-Z_][\\w.]*"},{"name":"string.quoted.single.thrift","begin":"'","end":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.string.end.thrift"}}},{"name":"string.quoted.double.thrift","begin":"\"","end":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.string.begin.thrift"}}},{"name":"meta.array.thrift","begin":"\\[","end":"\\]","patterns":[{"match":"[,;]"},{"include":"#value"}],"beginCaptures":{"0":{"name":"punctuation.definition.array.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.array.end.thrift"}}},{"name":"meta.map.thrift","begin":"\\{","end":"\\}","patterns":[{"match":"[:,;]"},{"include":"#value"}],"beginCaptures":{"0":{"name":"punctuation.definition.map.begin.thrift"}},"endCaptures":{"0":{"name":"punctuation.definition.map.end.thrift"}}},{"name":"invalid.illegal.thrift","match":"\\S"}]}}}