{ "name": "Ballerina", "scopeName": "source.ballerina", "patterns": [ { "include": "#serviceDefinition" }, { "include": "#functionDefinition" }, { "include": "#typeDefinition" }, { "include": "#annotationDefinition" }, { "include": "#documentationDef" }, { "include": "#mdDocumentation" }, { "include": "#objectDec" }, { "include": "#record" }, { "include": "#annotationAttachment" }, { "include": "#recordLiteral" }, { "include": "#comment" }, { "include": "#code" } ], "repository": { "annotationAttachment": { "patterns": [ { "name": "storage.type.annotation.ballerina", "match": "@((?:(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)):)?(?:(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))" } ] }, "annotationDefinition": { "patterns": [ { "begin": "\\bannotation\\b", "end": ";", "patterns": [ { "include": "#typeDescription" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } } } ] }, "booleans": { "patterns": [ { "name": "constant.language.boolean.ballerina", "match": "\\b(true|false)\\b" } ] }, "butClause": { "patterns": [ { "begin": "=\u003e", "end": ",|(?=\\})", "patterns": [ { "include": "#code" } ], "beginCaptures": { "0": { "name": "keyword.operator.ballerina" } } } ] }, "butExp": { "patterns": [ { "begin": "\\bbut\\b", "end": "\\}", "patterns": [ { "include": "#butExpBody" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } } } ] }, "butExpBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#parameter" }, { "include": "#butClause" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } } } ] }, "call": { "patterns": [ { "name": "entity.name.function.ballerina", "match": "((?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))\\s*(?=\\()" } ] }, "callableUnitBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#workerDef" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "code": { "patterns": [ { "include": "#booleans" }, { "include": "#matchStatement" }, { "include": "#butExp" }, { "include": "#xml" }, { "include": "#stringTemplate" }, { "include": "#keywords" }, { "include": "#strings" }, { "include": "#comment" }, { "include": "#annotationAttachment" }, { "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" }, { "include": "#maps" }, { "include": "#paranthesised" }, { "include": "#paranthesisedBracket" }, { "include": "#numbers" } ] }, "comment": { "patterns": [ { "name": "comment.ballerina", "match": "\\/\\/.*" } ] }, "constrainType": { "patterns": [ { "begin": "\u003c", "end": "\u003e", "patterns": [ { "include": "#comment" }, { "include": "#constrainType" }, { "name": "storage.type.ballerina", "match": "\\b((?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))\\b" } ], "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.ballerina" } } } ] }, "defaultValue": { "patterns": [ { "begin": "[=:]", "end": "(?=[,)])", "patterns": [ { "include": "#code" } ], "beginCaptures": { "0": { "name": "keyword.operator.ballerina" } } } ] }, "documentationBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "match": "(P|R|T|F|V)({{)(.*)(}})", "captures": { "1": { "name": "keyword.other.ballerina.documentation" }, "2": { "name": "keyword.other.ballerina.documentation" }, "3": { "name": "variable.parameter.ballerina.documentation" }, "4": { "name": "keyword.other.ballerina.documentation" } } }, { "name": "comment.block.code.ballerina.documentation", "begin": "\\```", "end": "\\```" }, { "name": "comment.block.code.ballerina.documentation", "begin": "\\``", "end": "\\``" }, { "name": "comment.block.code.ballerina.documentation", "begin": "\\`", "end": "\\`" }, { "name": "comment.block.ballerina.documentation", "match": "." } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } } } ] }, "documentationDef": { "patterns": [ { "begin": "\\b(?:documentation|deprecated)\\b", "end": "\\}", "patterns": [ { "include": "#documentationBody" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "delimiter.curly" } } } ] }, "errorDestructure": { "patterns": [ { "begin": "error", "end": "(?==\u003e)", "patterns": [ { "include": "#code" } ], "beginCaptures": { "0": { "name": "storage.type.ballerina" } } } ] }, "functionDefinition": { "patterns": [ { "begin": "\\bfunction\\b", "end": "\\}|(?=;|=)", "patterns": [ { "include": "#functionParameters" }, { "include": "#functionReturns" }, { "name": "keyword.ballerina", "match": "extern\\b" }, { "include": "#functionName" }, { "include": "#callableUnitBody" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "functionName": { "patterns": [ { "name": "entity.name.function.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ] }, "functionParameters": { "patterns": [ { "begin": "\\(", "end": "\\)", "patterns": [ { "name": "keyword", "match": "public" }, { "include": "#annotationAttachment" }, { "include": "#recordLiteral" }, { "include": "#parameter" }, { "include": "#parameterTuple" }, { "include": "#defaultValue" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "delimiter.parenthesis" } }, "endCaptures": { "0": { "name": "delimiter.parenthesis" } } } ] }, "functionReturns": { "patterns": [ { "begin": "\\breturns\\b", "end": "(?=\\{|;|,|=)", "patterns": [ { "include": "#record" }, { "include": "#objectDec" }, { "include": "#tupleType" }, { "name": "storage.type.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "curly" } } } ] }, "functionType": { "patterns": [ { "begin": "\\bfunction\\b", "end": "(?=\\,)|(?=\\|)|(?=\\:)|(?==\u003e)|(?=\\))|(?=\\])", "patterns": [ { "include": "#comment" }, { "include": "#functionTypeParamList" }, { "include": "#functionTypeReturns" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } } } ] }, "functionTypeParamList": { "patterns": [ { "begin": "\\(", "end": "\\)", "patterns": [ { "name": "keyword", "match": "public" }, { "include": "#annotationAttachment" }, { "include": "#recordLiteral" }, { "include": "#record" }, { "include": "#objectDec" }, { "include": "#functionType" }, { "include": "#constrainType" }, { "include": "#parameterTuple" }, { "include": "#functionTypeType" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "delimiter.parenthesis" } }, "endCaptures": { "0": { "name": "delimiter.parenthesis" } } } ] }, "functionTypeReturns": { "patterns": [ { "begin": "\\breturns\\b", "end": "(?=\\,)|(?:\\|)|(?=\\])|(?=\\))", "patterns": [ { "include": "#functionTypeReturnsParameter" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword" } } } ] }, "functionTypeReturnsParameter": { "patterns": [ { "begin": "((?=record|object|function)|(?:(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)))", "end": "(?=\\,)|(?:\\|)|(?:\\:)|(?==\u003e)|(?=\\))|(?=\\])", "patterns": [ { "include": "#record" }, { "include": "#objectDec" }, { "include": "#functionType" }, { "include": "#constrainType" }, { "include": "#defaultValue" }, { "include": "#comment" }, { "include": "#parameterTuple" }, { "name": "variable.parameter.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ], "beginCaptures": { "0": { "name": "storage.type.ballerina" } } } ] }, "functionTypeType": { "patterns": [ { "begin": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)", "end": "(?=\\,)|(?:\\|)|(?=\\])|(?=\\))", "beginCaptures": { "0": { "name": "storage.type.ballerina" } } } ] }, "keywords": { "patterns": [ { "name": "keyword.control.ballerina", "match": "\\b(if|else|fork|join|while|foreach|in|return|returns|break|transaction|transactional|retry|commit|rollback|continue|typeof|enum|wait|check|checkpanic|panic|trap|match)\\b" }, { "name": "keyword.other.ballerina", "match": "\\b(import|version|public|private|as|lock|new|record|limit|start|flush|untainted|tainted|abstract|external|final|listener|remote|is)\\b" }, { "name": "keyword.other.siddhi.ballerina", "match": "\\b(from|on|select|where)\\b" }, { "name": "keyword.other.ballerina", "match": "\\b(annotation|type|function|resource|service|worker|object|client|const|let|source|parameter|field|xmlns)\\b" }, { "name": "keyword.other.ballerina", "match": "\\b(true|false|null|table|key|default|do|base16|base64|conflict|outer|equals)\\b" }, { "name": "keyword.operator.ballerina", "match": "(!|%|\\+|\\-|~=|===|==|=|!=|!==|\u003c|\u003e|\u0026|\\||\\?:|\\.\\.\\.|\\?|\u003c=|=\u003e|\u003e=|\u0026\u0026|\\|\\||~|\u003e\u003e|\u003e\u003e\u003e)" }, { "include": "#types" } ] }, "literal": { "patterns": [ { "include": "#booleans" }, { "include": "#numbers" }, { "include": "#strings" }, { "include": "#maps" } ] }, "maps": { "patterns": [ { "begin": "\\{", "end": "\\}", "patterns": [ { "include": "#code" } ] } ] }, "matchBindingPattern": { "patterns": [ { "begin": "var", "end": "(?==\u003e)", "patterns": [ { "include": "#errorDestructure" }, { "name": "variable.parameter.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ], "beginCaptures": { "0": { "name": "storage.type.ballerina" } } } ] }, "matchStatement": { "patterns": [ { "begin": "\\bmatch\\b", "end": "\\}", "patterns": [ { "include": "#matchStatementBody" }, { "include": "#comment" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } } } ] }, "matchStatementBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#literal" }, { "include": "#matchBindingPattern" }, { "include": "#matchStatementPatternClause" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina.documentation" } } } ] }, "matchStatementPatternClause": { "patterns": [ { "begin": "=\u003e", "end": "((\\})|;|,)", "patterns": [ { "include": "#callableUnitBody" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } } } ] }, "mdDocumentation": { "patterns": [ { "include": "#mdDocumentationReturnParamDescription" }, { "include": "#mdDocumentationParamDescription" }, { "name": "comment.mddocs.ballerina", "match": "#.*" } ] }, "mdDocumentationParamDescription": { "patterns": [ { "begin": "(#)(?: ?)(\\+)(?: *)((?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))?(?: *)(-)?(.*)", "end": "(?=[^#\\r\\n]|(?:# ?\\+))", "patterns": [ { "name": "comment.mddocs.paramdesc.ballerina", "match": "#.*" } ], "beginCaptures": { "1": { "name": "comment.mddocs.ballerina" }, "2": { "name": "keyword.ballerina" }, "3": { "name": "variable.parameter.ballerina" }, "4": { "name": "keyword.ballerina" }, "5": { "name": "comment.mddocs.paramdesc.ballerina" } } } ] }, "mdDocumentationReturnParamDescription": { "patterns": [ { "begin": "(#)(?: ?)(\\+)(?: *)(return)(?: *)(-)?(.*)", "end": "(?=[^#\\r\\n]|(?:# ?\\+))", "patterns": [ { "name": "comment.mddocs.returnparamdesc.ballerina", "match": "#.*" } ], "beginCaptures": { "1": { "name": "comment.mddocs.ballerina" }, "2": { "name": "keyword.ballerina" }, "3": { "name": "keyword.ballerina" }, "4": { "name": "keyword.ballerina" }, "5": { "name": "comment.mddocs.returnparamdesc.ballerina" } } } ] }, "numbers": { "patterns": [ { "name": "constant.numeric.decimal.ballerina", "match": "\\b0[xX][\\da-f]+\\b|\\b\\d+(?:\\.(?:\\d+|$))?" } ] }, "objectBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#mdDocumentation" }, { "include": "#documentationDef" }, { "include": "#functionDefinition" }, { "include": "#annotationAttachment" }, { "name": "keyword.ballerina", "match": "(public|private|extern|resource|remote)" }, { "include": "#comment" }, { "include": "#variableDefInline" }, { "include": "#variableDef" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "objectDec": { "patterns": [ { "begin": "\\bobject\\b", "end": "\\}", "patterns": [ { "include": "#objectBody" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "delimiter.curly" } } } ] }, "objectInitBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#comment" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "objectInitParameters": { "patterns": [ { "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#code" }, { "name": "variable.parameter.ballerina", "match": "\\b((?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))\\b" } ], "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.ballerina" } } } ] }, "objectMemberFunctionDec": { "patterns": [ { "begin": "\\bfunction\\b", "end": "(?=(?:\\}|;))", "patterns": [ { "include": "#functionReceiver" }, { "include": "#functionParameters" }, { "include": "#functionReturns" }, { "include": "#functionName" }, { "include": "#callableUnitBody" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "parameter": { "patterns": [ { "begin": "((?=record|object|function)|(?:(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)))", "end": "(?:\\,)|(?:\\|)|(?:\\:)|(?==\u003e)|(?=\\))|(?=\\])", "patterns": [ { "include": "#record" }, { "include": "#objectDec" }, { "include": "#functionType" }, { "include": "#constrainType" }, { "include": "#defaultValue" }, { "include": "#comment" }, { "include": "#parameterTuple" }, { "name": "variable.parameter.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ], "beginCaptures": { "0": { "name": "storage.type.ballerina" } } } ] }, "parameterTuple": { "patterns": [ { "begin": "\\[", "end": "(?=\\,)|(?=\\|)|(?=\\:)|(?==\u003e)|(?=\\))", "patterns": [ { "include": "#record" }, { "include": "#objectDec" }, { "include": "#parameterTupleType" }, { "include": "#parameterTupleEnd" }, { "include": "#comment" } ] } ] }, "parameterTupleEnd": { "patterns": [ { "begin": "\\]", "end": "(?=\\,)|(?=\\|)|(?=\\:)|(?==\u003e)|(?=\\))", "patterns": [ { "name": "variable.parameter.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ] } ] }, "parameterTupleType": { "patterns": [ { "begin": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)", "end": "(?:\\,)|(?:\\|)|(?=\\])", "beginCaptures": { "0": { "name": "storage.type.ballerina" } } } ] }, "paranthesised": { "patterns": [ { "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#comment" }, { "include": "#code" } ] } ] }, "paranthesisedBracket": { "patterns": [ { "begin": "\\[", "end": "\\]", "patterns": [ { "include": "#comment" }, { "include": "#code" } ] } ] }, "record": { "patterns": [ { "begin": "\\brecord\\b", "end": "\\}", "patterns": [ { "include": "#recordBody" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "delimiter.curly" } } } ] }, "recordBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#annotationAttachment" }, { "include": "#comment" }, { "include": "#variableDefInline" }, { "include": "#variableDef" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "recordLiteral": { "patterns": [ { "begin": "\\{", "end": "\\}", "patterns": [ { "include": "#code" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "serviceBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#comment" }, { "include": "#mdDocumentation" }, { "include": "#documentationDef" }, { "include": "#annotationAttachment" }, { "include": "#functionDefinition" }, { "include": "#recordLiteral" }, { "include": "#code" } ], "beginCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "serviceDefinition": { "patterns": [ { "begin": "\\bservice\\b", "end": "\\}|;|=", "patterns": [ { "include": "#comment" }, { "include": "#serviceBody" }, { "include": "#serviceOn" }, { "include": "#serviceName" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.block.ballerina" } } } ] }, "serviceName": { "patterns": [ { "name": "entity.name.function.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ] }, "serviceOn": { "patterns": [ { "begin": "on", "end": "(?={)", "patterns": [ { "include": "#code" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } } } ] }, "stringTemplate": { "patterns": [ { "begin": "(\\bstring)(\\s*)(`)", "end": "`", "patterns": [ { "name": "constant.character.escape.ballerina", "match": "\\\\." }, { "include": "#templateVariable" }, { "name": "string", "match": "." } ], "beginCaptures": { "1": { "name": "keyword.ballerina" }, "2": {}, "3": { "name": "string.template.ballerina" } }, "endCaptures": { "0": { "name": "string.template.ballerina" } } } ] }, "strings": { "patterns": [ { "begin": "\\\"", "end": "\\\"", "patterns": [ { "name": "constant.character.escape.ballerina", "match": "\\\\." }, { "name": "string", "match": "." } ], "beginCaptures": { "0": { "name": "string.begin.ballerina" } }, "endCaptures": { "0": { "name": "string.end.ballerina" } } } ] }, "templateVariable": { "patterns": [ { "begin": "\\${", "end": "}", "patterns": [ { "include": "#code" } ], "beginCaptures": { "0": { "name": "constant.character.escape.ballerina" } }, "endCaptures": { "0": { "name": "constant.character.escape.ballerina" } } } ] }, "tupleType": { "patterns": [ { "begin": "\\[", "end": "(?=\\]|;)", "patterns": [ { "include": "#comment" }, { "include": "#constrainType" }, { "name": "storage.type.ballerina", "match": "\\b((?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))\\b" } ] } ] }, "typeDefinition": { "patterns": [ { "begin": "\\btype\\b", "end": ";", "patterns": [ { "include": "#comment" }, { "include": "#typeDescription" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } }, "endCaptures": { "0": { "name": "source.ballerina" } } } ] }, "typeDescription": { "patterns": [ { "begin": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)", "end": "(?=;)", "patterns": [ { "include": "#comment" }, { "include": "#objectDec" }, { "include": "#record" }, { "include": "#literal" }, { "name": "storage.type.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ], "beginCaptures": { "0": { "name": "entity.name.function.ballerina" } }, "endCaptures": { "0": { "name": "source.ballerina" } } } ] }, "types": { "patterns": [ { "name": "storage.type.ballerina", "match": "\\b(boolean|int|float|string|decimal|handle|var|any|anydata|byte|future|typedesc)\\b" }, { "name": "storage.type.ballerina", "match": "\\b(map|json|xml|error|never|readonly|distinct)\\b" }, { "name": "storage.type.ballerina", "match": "\\b(stream)\\b" } ] }, "variableDef": { "patterns": [ { "begin": "(?:(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))(?: |\\t)|(?=\\()", "end": "(?:(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+))|(?=\\,)|(?=;)|\\.\\.\\.", "patterns": [ { "include": "#tupleType" }, { "include": "#constrainType" }, { "include": "#comment" } ], "beginCaptures": { "0": { "name": "storage.type.ballerina" } }, "endCaptures": { "0": { "name": "source.ballerina" } } } ] }, "variableDefInline": { "patterns": [ { "begin": "(?=record)|(?=object)", "end": "(?=;)", "patterns": [ { "include": "#record" }, { "include": "#objectDec" }, { "name": "source.ballerina", "match": "(?:'?(?:(?:[^ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s\\\\])|\\\\(?:[ (){}\\[\\]\\-?*=\u003e\u003c?;\"',.\\s])|\\\\)+)" } ] } ] }, "workerBody": { "patterns": [ { "begin": "\\{", "end": "(?=\\})", "patterns": [ { "include": "#code" } ] } ] }, "workerDef": { "patterns": [ { "begin": "\\bworker\\b", "end": "\\}", "patterns": [ { "include": "#workerBody" } ], "beginCaptures": { "0": { "name": "keyword.ballerina" } } } ] }, "xml": { "patterns": [ { "begin": "(\\bxml)(\\s*)(`)", "end": "`", "patterns": [ { "include": "#xmlTag" }, { "include": "#xmlComment" }, { "include": "#templateVariable" }, { "name": "text.xml.ballerina", "match": "." } ], "beginCaptures": { "1": { "name": "keyword.ballerina" }, "2": {}, "3": { "name": "string.template.ballerina" } }, "endCaptures": { "0": { "name": "string.template.ballerina" } } } ] }, "xmlComment": { "patterns": [ { "name": "comment.block.xml.ballerina", "begin": "\u003c!--", "end": "--\u003e", "beginCaptures": { "0": { "name": "comment.block.xml.ballerina" } }, "endCaptures": { "0": { "name": "comment.block.xml.ballerina" } } } ] }, "xmlDoubleQuotedString": { "patterns": [ { "begin": "\\\"", "end": "\\\"", "patterns": [ { "name": "constant.character.escape.ballerina", "match": "\\\\." }, { "name": "string", "match": "." } ], "beginCaptures": { "0": { "name": "string.begin.ballerina" } }, "endCaptures": { "0": { "name": "string.end.ballerina" } } } ] }, "xmlSingleQuotedString": { "patterns": [ { "begin": "\\'", "end": "\\'", "patterns": [ { "name": "constant.character.escape.ballerina", "match": "\\\\." }, { "name": "string", "match": "." } ], "beginCaptures": { "0": { "name": "string.begin.ballerina" } }, "endCaptures": { "0": { "name": "string.end.ballerina" } } } ] }, "xmlTag": { "patterns": [ { "begin": "(\u003c\\/?\\??)\\s*([-_a-zA-Z0-9]+)", "end": "\\??\\/?\u003e", "patterns": [ { "include": "#xmlSingleQuotedString" }, { "include": "#xmlDoubleQuotedString" }, { "name": "entity.other.attribute-name.xml.ballerina", "match": "([a-zA-Z-]+)" } ], "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.xml.ballerina" }, "2": { "name": "entity.name.tag.xml.ballerina" } }, "endCaptures": { "0": { "name": "punctuation.definition.tag.begin.xml.ballerina" } } } ] } } }