Path: blob/main/extensions/go/syntaxes/go.tmLanguage.json
3292 views
{1"information_for_contributors": [2"This file has been converted from https://github.com/worlpaker/go-syntax/blob/master/syntaxes/go.tmLanguage.json",3"If you want to provide a fix or improvement, please create a pull request against the original repository.",4"Once accepted there, we are happy to receive an update request."5],6"version": "https://github.com/worlpaker/go-syntax/commit/8c70c078f56d237f72574ce49cc95839c4f8a741",7"name": "Go",8"scopeName": "source.go",9"patterns": [10{11"include": "#statements"12}13],14"repository": {15"statements": {16"patterns": [17{18"include": "#package_name"19},20{21"include": "#import"22},23{24"include": "#syntax_errors"25},26{27"include": "#group-functions"28},29{30"include": "#group-types"31},32{33"include": "#group-variables"34},35{36"include": "#hover"37}38]39},40"group-functions": {41"comment": "all statements related to functions",42"patterns": [43{44"include": "#function_declaration"45},46{47"include": "#functions_inline"48},49{50"include": "#functions"51},52{53"include": "#built_in_functions"54},55{56"include": "#support_functions"57}58]59},60"group-types": {61"comment": "all statements related to types",62"patterns": [63{64"include": "#other_struct_interface_expressions"65},66{67"include": "#type_assertion_inline"68},69{70"include": "#struct_variables_types"71},72{73"include": "#interface_variables_types"74},75{76"include": "#single_type"77},78{79"include": "#multi_types"80},81{82"include": "#struct_interface_declaration"83},84{85"include": "#double_parentheses_types"86},87{88"include": "#switch_types"89},90{91"include": "#type-declarations"92}93]94},95"group-variables": {96"comment": "all statements related to variables",97"patterns": [98{99"include": "#const_assignment"100},101{102"include": "#var_assignment"103},104{105"include": "#variable_assignment"106},107{108"include": "#label_loop_variables"109},110{111"include": "#slice_index_variables"112},113{114"include": "#property_variables"115},116{117"include": "#switch_variables"118},119{120"include": "#other_variables"121}122]123},124"type-declarations": {125"comment": "includes all type declarations",126"patterns": [127{128"include": "#language_constants"129},130{131"include": "#comments"132},133{134"include": "#map_types"135},136{137"include": "#brackets"138},139{140"include": "#delimiters"141},142{143"include": "#keywords"144},145{146"include": "#operators"147},148{149"include": "#runes"150},151{152"include": "#storage_types"153},154{155"include": "#raw_string_literals"156},157{158"include": "#string_literals"159},160{161"include": "#numeric_literals"162},163{164"include": "#terminators"165}166]167},168"type-declarations-without-brackets": {169"comment": "includes all type declarations without brackets (in some cases, brackets need to be captured manually)",170"patterns": [171{172"include": "#language_constants"173},174{175"include": "#comments"176},177{178"include": "#map_types"179},180{181"include": "#delimiters"182},183{184"include": "#keywords"185},186{187"include": "#operators"188},189{190"include": "#runes"191},192{193"include": "#storage_types"194},195{196"include": "#raw_string_literals"197},198{199"include": "#string_literals"200},201{202"include": "#numeric_literals"203},204{205"include": "#terminators"206}207]208},209"parameter-variable-types": {210"comment": "function and generic parameter types",211"patterns": [212{213"match": "\\{",214"name": "punctuation.definition.begin.bracket.curly.go"215},216{217"match": "\\}",218"name": "punctuation.definition.end.bracket.curly.go"219},220{221"begin": "([\\w\\.\\*]+)?(\\[)",222"beginCaptures": {223"1": {224"patterns": [225{226"include": "#type-declarations"227},228{229"match": "\\w+",230"name": "entity.name.type.go"231}232]233},234"2": {235"name": "punctuation.definition.begin.bracket.square.go"236}237},238"end": "\\]",239"endCaptures": {240"0": {241"name": "punctuation.definition.end.bracket.square.go"242}243},244"patterns": [245{246"include": "#generic_param_types"247}248]249},250{251"begin": "\\(",252"beginCaptures": {253"0": {254"name": "punctuation.definition.begin.bracket.round.go"255}256},257"end": "\\)",258"endCaptures": {259"0": {260"name": "punctuation.definition.end.bracket.round.go"261}262},263"patterns": [264{265"include": "#function_param_types"266}267]268}269]270},271"language_constants": {272"comment": "Language constants",273"match": "\\b(?:(true|false)|(nil)|(iota))\\b",274"captures": {275"1": {276"name": "constant.language.boolean.go"277},278"2": {279"name": "constant.language.null.go"280},281"3": {282"name": "constant.language.iota.go"283}284}285},286"comments": {287"patterns": [288{289"name": "comment.block.go",290"begin": "(\\/\\*)",291"beginCaptures": {292"1": {293"name": "punctuation.definition.comment.go"294}295},296"end": "(\\*\\/)",297"endCaptures": {298"1": {299"name": "punctuation.definition.comment.go"300}301}302},303{304"name": "comment.line.double-slash.go",305"begin": "(\\/\\/)",306"beginCaptures": {307"1": {308"name": "punctuation.definition.comment.go"309}310},311"end": "(?:\\n|$)"312}313]314},315"map_types": {316"comment": "map types",317"begin": "(\\bmap\\b)(\\[)",318"beginCaptures": {319"1": {320"name": "keyword.map.go"321},322"2": {323"name": "punctuation.definition.begin.bracket.square.go"324}325},326"end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?)?)",327"endCaptures": {328"1": {329"name": "punctuation.definition.end.bracket.square.go"330},331"2": {332"patterns": [333{334"include": "#type-declarations-without-brackets"335},336{337"match": "\\[",338"name": "punctuation.definition.begin.bracket.square.go"339},340{341"match": "\\]",342"name": "punctuation.definition.end.bracket.square.go"343},344{345"match": "\\w+",346"name": "entity.name.type.go"347}348]349}350},351"patterns": [352{353"include": "#type-declarations-without-brackets"354},355{356"include": "#parameter-variable-types"357},358{359"include": "#functions"360},361{362"match": "\\[",363"name": "punctuation.definition.begin.bracket.square.go"364},365{366"match": "\\]",367"name": "punctuation.definition.end.bracket.square.go"368},369{370"match": "\\{",371"name": "punctuation.definition.begin.bracket.curly.go"372},373{374"match": "\\}",375"name": "punctuation.definition.end.bracket.curly.go"376},377{378"match": "\\(",379"name": "punctuation.definition.begin.bracket.round.go"380},381{382"match": "\\)",383"name": "punctuation.definition.end.bracket.round.go"384},385{386"match": "\\w+",387"name": "entity.name.type.go"388}389]390},391"brackets": {392"patterns": [393{394"begin": "\\{",395"beginCaptures": {396"0": {397"name": "punctuation.definition.begin.bracket.curly.go"398}399},400"end": "\\}",401"endCaptures": {402"0": {403"name": "punctuation.definition.end.bracket.curly.go"404}405},406"patterns": [407{408"include": "$self"409}410]411},412{413"begin": "\\(",414"beginCaptures": {415"0": {416"name": "punctuation.definition.begin.bracket.round.go"417}418},419"end": "\\)",420"endCaptures": {421"0": {422"name": "punctuation.definition.end.bracket.round.go"423}424},425"patterns": [426{427"include": "$self"428}429]430},431{432"begin": "\\[",433"beginCaptures": {434"0": {435"name": "punctuation.definition.begin.bracket.square.go"436}437},438"end": "\\]",439"endCaptures": {440"0": {441"name": "punctuation.definition.end.bracket.square.go"442}443},444"patterns": [445{446"include": "$self"447}448]449}450]451},452"delimiters": {453"patterns": [454{455"match": "\\,",456"name": "punctuation.other.comma.go"457},458{459"match": "\\.(?!\\.\\.)",460"name": "punctuation.other.period.go"461},462{463"match": ":(?!=)",464"name": "punctuation.other.colon.go"465}466]467},468"keywords": {469"patterns": [470{471"comment": "Flow control keywords",472"match": "\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\b",473"name": "keyword.control.go"474},475{476"match": "\\bchan\\b",477"name": "keyword.channel.go"478},479{480"match": "\\bconst\\b",481"name": "keyword.const.go"482},483{484"match": "\\bvar\\b",485"name": "keyword.var.go"486},487{488"match": "\\bfunc\\b",489"name": "keyword.function.go"490},491{492"match": "\\binterface\\b",493"name": "keyword.interface.go"494},495{496"match": "\\bmap\\b",497"name": "keyword.map.go"498},499{500"match": "\\bstruct\\b",501"name": "keyword.struct.go"502},503{504"match": "\\bimport\\b",505"name": "keyword.control.import.go"506},507{508"match": "\\btype\\b",509"name": "keyword.type.go"510}511]512},513"operators": {514"comment": "Note that the order here is very important!",515"patterns": [516{517"match": "(?<!\\w)(?:\\*|\\&)+(?:(?!\\d)(?=(?:[\\w\\[\\]])|(?:\\<\\-)))",518"name": "keyword.operator.address.go"519},520{521"match": "<\\-",522"name": "keyword.operator.channel.go"523},524{525"match": "\\-\\-",526"name": "keyword.operator.decrement.go"527},528{529"match": "\\+\\+",530"name": "keyword.operator.increment.go"531},532{533"match": "(==|!=|<=|>=|<(?!<)|>(?!>))",534"name": "keyword.operator.comparison.go"535},536{537"match": "(&&|\\|\\||!)",538"name": "keyword.operator.logical.go"539},540{541"match": "(=|\\+=|\\-=|\\|=|\\^=|\\*=|/=|:=|%=|<<=|>>=|&\\^=|&=)",542"name": "keyword.operator.assignment.go"543},544{545"match": "(\\+|\\-|\\*|/|%)",546"name": "keyword.operator.arithmetic.go"547},548{549"match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>|\\~)",550"name": "keyword.operator.arithmetic.bitwise.go"551},552{553"match": "\\.\\.\\.",554"name": "keyword.operator.ellipsis.go"555}556]557},558"runes": {559"patterns": [560{561"begin": "'",562"beginCaptures": {563"0": {564"name": "punctuation.definition.string.begin.go"565}566},567"end": "'",568"endCaptures": {569"0": {570"name": "punctuation.definition.string.end.go"571}572},573"name": "string.quoted.rune.go",574"patterns": [575{576"match": "\\G(\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})|.)(?=')",577"name": "constant.other.rune.go"578},579{580"match": "[^']+",581"name": "invalid.illegal.unknown-rune.go"582}583]584}585]586},587"storage_types": {588"patterns": [589{590"match": "\\bbool\\b",591"name": "storage.type.boolean.go"592},593{594"match": "\\bbyte\\b",595"name": "storage.type.byte.go"596},597{598"match": "\\berror\\b",599"name": "storage.type.error.go"600},601{602"match": "\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\b",603"name": "storage.type.numeric.go"604},605{606"match": "\\brune\\b",607"name": "storage.type.rune.go"608},609{610"match": "\\bstring\\b",611"name": "storage.type.string.go"612},613{614"match": "\\buintptr\\b",615"name": "storage.type.uintptr.go"616},617{618"match": "\\bany\\b",619"name": "entity.name.type.any.go"620},621{622"match": "\\bcomparable\\b",623"name": "entity.name.type.comparable.go"624}625]626},627"raw_string_literals": {628"comment": "Raw string literals",629"begin": "`",630"beginCaptures": {631"0": {632"name": "punctuation.definition.string.begin.go"633}634},635"end": "`",636"endCaptures": {637"0": {638"name": "punctuation.definition.string.end.go"639}640},641"name": "string.quoted.raw.go",642"patterns": [643{644"include": "#string_placeholder"645}646]647},648"string_literals": {649"patterns": [650{651"comment": "Interpreted string literals",652"begin": "\"",653"beginCaptures": {654"0": {655"name": "punctuation.definition.string.begin.go"656}657},658"end": "\"",659"endCaptures": {660"0": {661"name": "punctuation.definition.string.end.go"662}663},664"name": "string.quoted.double.go",665"patterns": [666{667"include": "#string_escaped_char"668},669{670"include": "#string_placeholder"671}672]673}674]675},676"string_escaped_char": {677"patterns": [678{679"match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})",680"name": "constant.character.escape.go"681},682{683"match": "\\\\[^0-7xuUabfnrtv\\'\"]",684"name": "invalid.illegal.unknown-escape.go"685}686]687},688"string_placeholder": {689"patterns": [690{691"match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGspw]",692"name": "constant.other.placeholder.go"693}694]695},696"numeric_literals": {697"match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])*",698"captures": {699"0": {700"patterns": [701{702"begin": "(?=.)",703"end": "(?:\\n|$)",704"patterns": [705{706"match": "(?:(?:(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$)|\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|\\G((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))",707"captures": {708"1": {709"name": "constant.numeric.decimal.go",710"patterns": [711{712"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",713"name": "punctuation.separator.constant.numeric.go"714}715]716},717"2": {718"name": "punctuation.separator.constant.numeric.go"719},720"3": {721"name": "constant.numeric.decimal.point.go"722},723"4": {724"name": "constant.numeric.decimal.go",725"patterns": [726{727"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",728"name": "punctuation.separator.constant.numeric.go"729}730]731},732"5": {733"name": "punctuation.separator.constant.numeric.go"734},735"6": {736"name": "keyword.other.unit.exponent.decimal.go"737},738"7": {739"name": "keyword.operator.plus.exponent.decimal.go"740},741"8": {742"name": "keyword.operator.minus.exponent.decimal.go"743},744"9": {745"name": "constant.numeric.exponent.decimal.go",746"patterns": [747{748"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",749"name": "punctuation.separator.constant.numeric.go"750}751]752},753"10": {754"name": "keyword.other.unit.imaginary.go"755},756"11": {757"name": "constant.numeric.decimal.go",758"patterns": [759{760"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",761"name": "punctuation.separator.constant.numeric.go"762}763]764},765"12": {766"name": "punctuation.separator.constant.numeric.go"767},768"13": {769"name": "keyword.other.unit.exponent.decimal.go"770},771"14": {772"name": "keyword.operator.plus.exponent.decimal.go"773},774"15": {775"name": "keyword.operator.minus.exponent.decimal.go"776},777"16": {778"name": "constant.numeric.exponent.decimal.go",779"patterns": [780{781"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",782"name": "punctuation.separator.constant.numeric.go"783}784]785},786"17": {787"name": "keyword.other.unit.imaginary.go"788},789"18": {790"name": "constant.numeric.decimal.point.go"791},792"19": {793"name": "constant.numeric.decimal.go",794"patterns": [795{796"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",797"name": "punctuation.separator.constant.numeric.go"798}799]800},801"20": {802"name": "punctuation.separator.constant.numeric.go"803},804"21": {805"name": "keyword.other.unit.exponent.decimal.go"806},807"22": {808"name": "keyword.operator.plus.exponent.decimal.go"809},810"23": {811"name": "keyword.operator.minus.exponent.decimal.go"812},813"24": {814"name": "constant.numeric.exponent.decimal.go",815"patterns": [816{817"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",818"name": "punctuation.separator.constant.numeric.go"819}820]821},822"25": {823"name": "keyword.other.unit.imaginary.go"824},825"26": {826"name": "keyword.other.unit.hexadecimal.go"827},828"27": {829"name": "constant.numeric.hexadecimal.go",830"patterns": [831{832"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",833"name": "punctuation.separator.constant.numeric.go"834}835]836},837"28": {838"name": "punctuation.separator.constant.numeric.go"839},840"29": {841"name": "constant.numeric.hexadecimal.go"842},843"30": {844"name": "constant.numeric.hexadecimal.go",845"patterns": [846{847"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",848"name": "punctuation.separator.constant.numeric.go"849}850]851},852"31": {853"name": "punctuation.separator.constant.numeric.go"854},855"32": {856"name": "keyword.other.unit.exponent.hexadecimal.go"857},858"33": {859"name": "keyword.operator.plus.exponent.hexadecimal.go"860},861"34": {862"name": "keyword.operator.minus.exponent.hexadecimal.go"863},864"35": {865"name": "constant.numeric.exponent.hexadecimal.go",866"patterns": [867{868"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",869"name": "punctuation.separator.constant.numeric.go"870}871]872},873"36": {874"name": "keyword.other.unit.imaginary.go"875},876"37": {877"name": "keyword.other.unit.hexadecimal.go"878},879"38": {880"name": "constant.numeric.hexadecimal.go",881"patterns": [882{883"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",884"name": "punctuation.separator.constant.numeric.go"885}886]887},888"39": {889"name": "punctuation.separator.constant.numeric.go"890},891"40": {892"name": "keyword.other.unit.exponent.hexadecimal.go"893},894"41": {895"name": "keyword.operator.plus.exponent.hexadecimal.go"896},897"42": {898"name": "keyword.operator.minus.exponent.hexadecimal.go"899},900"43": {901"name": "constant.numeric.exponent.hexadecimal.go",902"patterns": [903{904"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",905"name": "punctuation.separator.constant.numeric.go"906}907]908},909"44": {910"name": "keyword.other.unit.imaginary.go"911},912"45": {913"name": "keyword.other.unit.hexadecimal.go"914},915"46": {916"name": "constant.numeric.hexadecimal.go"917},918"47": {919"name": "constant.numeric.hexadecimal.go",920"patterns": [921{922"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",923"name": "punctuation.separator.constant.numeric.go"924}925]926},927"48": {928"name": "punctuation.separator.constant.numeric.go"929},930"49": {931"name": "keyword.other.unit.exponent.hexadecimal.go"932},933"50": {934"name": "keyword.operator.plus.exponent.hexadecimal.go"935},936"51": {937"name": "keyword.operator.minus.exponent.hexadecimal.go"938},939"52": {940"name": "constant.numeric.exponent.hexadecimal.go",941"patterns": [942{943"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",944"name": "punctuation.separator.constant.numeric.go"945}946]947},948"53": {949"name": "keyword.other.unit.imaginary.go"950}951}952},953{954"match": "(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$)|(\\G0[bB])_?([01](?:[01]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))|(\\G0[oO]?)_?((?:[0-7]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))+)(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))",955"captures": {956"1": {957"name": "constant.numeric.decimal.go",958"patterns": [959{960"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",961"name": "punctuation.separator.constant.numeric.go"962}963]964},965"2": {966"name": "punctuation.separator.constant.numeric.go"967},968"3": {969"name": "keyword.other.unit.imaginary.go"970},971"4": {972"name": "keyword.other.unit.binary.go"973},974"5": {975"name": "constant.numeric.binary.go",976"patterns": [977{978"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",979"name": "punctuation.separator.constant.numeric.go"980}981]982},983"6": {984"name": "punctuation.separator.constant.numeric.go"985},986"7": {987"name": "keyword.other.unit.imaginary.go"988},989"8": {990"name": "keyword.other.unit.octal.go"991},992"9": {993"name": "constant.numeric.octal.go",994"patterns": [995{996"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",997"name": "punctuation.separator.constant.numeric.go"998}999]1000},1001"10": {1002"name": "punctuation.separator.constant.numeric.go"1003},1004"11": {1005"name": "keyword.other.unit.imaginary.go"1006},1007"12": {1008"name": "keyword.other.unit.hexadecimal.go"1009},1010"13": {1011"name": "constant.numeric.hexadecimal.go",1012"patterns": [1013{1014"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",1015"name": "punctuation.separator.constant.numeric.go"1016}1017]1018},1019"14": {1020"name": "punctuation.separator.constant.numeric.go"1021},1022"15": {1023"name": "keyword.other.unit.imaginary.go"1024}1025}1026},1027{1028"match": "(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])+",1029"name": "invalid.illegal.constant.numeric.go"1030}1031]1032}1033]1034}1035}1036},1037"terminators": {1038"comment": "Terminators",1039"match": ";",1040"name": "punctuation.terminator.go"1041},1042"package_name": {1043"patterns": [1044{1045"comment": "package name",1046"begin": "\\b(package)\\s+",1047"beginCaptures": {1048"1": {1049"name": "keyword.package.go"1050}1051},1052"end": "(?!\\G)",1053"patterns": [1054{1055"match": "\\d\\w*",1056"name": "invalid.illegal.identifier.go"1057},1058{1059"match": "\\w+",1060"name": "entity.name.type.package.go"1061}1062]1063}1064]1065},1066"import": {1067"comment": "import",1068"patterns": [1069{1070"comment": "import",1071"begin": "\\b(import)\\s+",1072"beginCaptures": {1073"1": {1074"name": "keyword.control.import.go"1075}1076},1077"end": "(?!\\G)",1078"patterns": [1079{1080"include": "#imports"1081}1082]1083}1084]1085},1086"imports": {1087"comment": "import package(s)",1088"patterns": [1089{1090"match": "(\\s*[\\w\\.]+)?\\s*((\")([^\"]*)(\"))",1091"captures": {1092"1": {1093"patterns": [1094{1095"include": "#delimiters"1096},1097{1098"match": "\\w+",1099"name": "variable.other.import.go"1100}1101]1102},1103"2": {1104"name": "string.quoted.double.go"1105},1106"3": {1107"name": "punctuation.definition.string.begin.go"1108},1109"4": {1110"name": "entity.name.import.go"1111},1112"5": {1113"name": "punctuation.definition.string.end.go"1114}1115}1116},1117{1118"begin": "\\(",1119"beginCaptures": {1120"0": {1121"name": "punctuation.definition.imports.begin.bracket.round.go"1122}1123},1124"end": "\\)",1125"endCaptures": {1126"0": {1127"name": "punctuation.definition.imports.end.bracket.round.go"1128}1129},1130"patterns": [1131{1132"include": "#comments"1133},1134{1135"include": "#imports"1136}1137]1138},1139{1140"include": "$self"1141}1142]1143},1144"function_declaration": {1145"comment": "Function declarations",1146"begin": "(?:^(\\bfunc\\b)(?:\\s*(\\([^\\)]+\\)\\s*)?(?:(\\w+)(?=\\(|\\[))?))",1147"beginCaptures": {1148"1": {1149"name": "keyword.function.go"1150},1151"2": {1152"patterns": [1153{1154"begin": "\\(",1155"beginCaptures": {1156"0": {1157"name": "punctuation.definition.begin.bracket.round.go"1158}1159},1160"end": "\\)",1161"endCaptures": {1162"0": {1163"name": "punctuation.definition.end.bracket.round.go"1164}1165},1166"patterns": [1167{1168"match": "(?:(\\w+(?:\\s+))?((?:[\\w\\.\\*]+)(?:\\[(?:(?:(?:[\\w\\.\\*]+)(?:\\,\\s+)?)+)?\\])?))",1169"captures": {1170"1": {1171"name": "variable.parameter.go"1172},1173"2": {1174"patterns": [1175{1176"include": "#type-declarations-without-brackets"1177},1178{1179"include": "#parameter-variable-types"1180},1181{1182"match": "\\w+",1183"name": "entity.name.type.go"1184}1185]1186}1187}1188},1189{1190"include": "$self"1191}1192]1193}1194]1195},1196"3": {1197"patterns": [1198{1199"match": "\\d\\w*",1200"name": "invalid.illegal.identifier.go"1201},1202{1203"match": "\\w+",1204"name": "entity.name.function.go"1205}1206]1207}1208},1209"end": "(?:(?<=\\))\\s*((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b))[\\w\\.\\-\\*\\[\\]]+)?\\s*(?=\\{))",1210"endCaptures": {1211"1": {1212"patterns": [1213{1214"include": "#type-declarations-without-brackets"1215},1216{1217"include": "#parameter-variable-types"1218},1219{1220"match": "\\w+",1221"name": "entity.name.type.go"1222}1223]1224}1225},1226"patterns": [1227{1228"begin": "\\(",1229"beginCaptures": {1230"0": {1231"name": "punctuation.definition.begin.bracket.round.go"1232}1233},1234"end": "\\)",1235"endCaptures": {1236"0": {1237"name": "punctuation.definition.end.bracket.round.go"1238}1239},1240"patterns": [1241{1242"include": "#function_param_types"1243}1244]1245},1246{1247"begin": "([\\w\\.\\*]+)?(\\[)",1248"beginCaptures": {1249"1": {1250"patterns": [1251{1252"include": "#type-declarations"1253},1254{1255"match": "\\w+",1256"name": "entity.name.type.go"1257}1258]1259},1260"2": {1261"name": "punctuation.definition.begin.bracket.square.go"1262}1263},1264"end": "\\]",1265"endCaptures": {1266"0": {1267"name": "punctuation.definition.end.bracket.square.go"1268}1269},1270"patterns": [1271{1272"include": "#generic_param_types"1273}1274]1275},1276{1277"comment": "single function as a type returned type(s) declaration",1278"match": "(?:(?<=\\))(?:\\s*)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?[\\w\\*\\.\\[\\]\\<\\>\\-]+(?:\\s*)(?:\\/(?:\\/|\\*).*)?)$)",1279"captures": {1280"1": {1281"patterns": [1282{1283"include": "#type-declarations-without-brackets"1284},1285{1286"include": "#parameter-variable-types"1287},1288{1289"match": "\\w+",1290"name": "entity.name.type.go"1291}1292]1293}1294}1295},1296{1297"include": "$self"1298}1299]1300},1301"function_param_types": {1302"comment": "function parameter variables and types",1303"patterns": [1304{1305"include": "#struct_variables_types"1306},1307{1308"include": "#interface_variables_types"1309},1310{1311"include": "#type-declarations-without-brackets"1312},1313{1314"comment": "struct/interface type declaration",1315"match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b\\s*\\{)",1316"captures": {1317"1": {1318"patterns": [1319{1320"include": "#type-declarations"1321},1322{1323"match": "\\w+",1324"name": "variable.parameter.go"1325}1326]1327}1328}1329},1330{1331"comment": "multiple parameters one type -with multilines",1332"match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)",1333"captures": {1334"1": {1335"patterns": [1336{1337"include": "#type-declarations"1338},1339{1340"match": "\\w+",1341"name": "variable.parameter.go"1342}1343]1344}1345}1346},1347{1348"comment": "multiple params and types | multiple params one type | one param one type",1349"match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.\\[\\]]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:[\\[\\]\\*]+)?[\\w\\*\\.]+(?:\\[(?:[^\\]]+)\\])?(?:[\\w\\.\\*]+)?)+)))",1350"captures": {1351"1": {1352"patterns": [1353{1354"include": "#delimiters"1355},1356{1357"match": "\\w+",1358"name": "variable.parameter.go"1359}1360]1361},1362"2": {1363"patterns": [1364{1365"include": "#type-declarations-without-brackets"1366},1367{1368"include": "#parameter-variable-types"1369},1370{1371"match": "\\w+",1372"name": "entity.name.type.go"1373}1374]1375}1376}1377},1378{1379"begin": "([\\w\\.\\*]+)?(\\[)",1380"beginCaptures": {1381"1": {1382"patterns": [1383{1384"include": "#type-declarations"1385},1386{1387"match": "\\w+",1388"name": "entity.name.type.go"1389}1390]1391},1392"2": {1393"name": "punctuation.definition.begin.bracket.square.go"1394}1395},1396"end": "\\]",1397"endCaptures": {1398"0": {1399"name": "punctuation.definition.end.bracket.square.go"1400}1401},1402"patterns": [1403{1404"include": "#generic_param_types"1405}1406]1407},1408{1409"begin": "\\(",1410"beginCaptures": {1411"0": {1412"name": "punctuation.definition.begin.bracket.round.go"1413}1414},1415"end": "\\)",1416"endCaptures": {1417"0": {1418"name": "punctuation.definition.end.bracket.round.go"1419}1420},1421"patterns": [1422{1423"include": "#function_param_types"1424}1425]1426},1427{1428"comment": "other types",1429"match": "([\\w\\.]+)",1430"captures": {1431"1": {1432"patterns": [1433{1434"include": "#type-declarations"1435},1436{1437"match": "\\w+",1438"name": "entity.name.type.go"1439}1440]1441}1442}1443},1444{1445"include": "$self"1446}1447]1448},1449"generic_param_types": {1450"comment": "generic parameter variables and types",1451"patterns": [1452{1453"include": "#struct_variables_types"1454},1455{1456"include": "#interface_variables_types"1457},1458{1459"include": "#type-declarations-without-brackets"1460},1461{1462"comment": "struct/interface type declaration",1463"match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b\\s*\\{)",1464"captures": {1465"1": {1466"patterns": [1467{1468"include": "#type-declarations"1469},1470{1471"match": "\\w+",1472"name": "variable.parameter.go"1473}1474]1475}1476}1477},1478{1479"comment": "multiple parameters one type -with multilines",1480"match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)",1481"captures": {1482"1": {1483"patterns": [1484{1485"include": "#type-declarations"1486},1487{1488"match": "\\w+",1489"name": "variable.parameter.go"1490}1491]1492}1493}1494},1495{1496"comment": "multiple params and types | multiple types one param",1497"match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^\\)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.]+)|(?:\\((?:[^\\)]+)?\\))))?)|(?:(?:(?:[\\w\\*\\.\\~]+)|(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\]))(?:[\\w\\.\\*]+)?)+)))",1498"captures": {1499"1": {1500"patterns": [1501{1502"include": "#delimiters"1503},1504{1505"match": "\\w+",1506"name": "variable.parameter.go"1507}1508]1509},1510"2": {1511"patterns": [1512{1513"include": "#type-declarations-without-brackets"1514},1515{1516"include": "#parameter-variable-types"1517},1518{1519"match": "\\w+",1520"name": "entity.name.type.go"1521}1522]1523},1524"3": {1525"patterns": [1526{1527"include": "#type-declarations"1528},1529{1530"match": "\\w+",1531"name": "entity.name.type.go"1532}1533]1534}1535}1536},1537{1538"begin": "([\\w\\.\\*]+)?(\\[)",1539"beginCaptures": {1540"1": {1541"patterns": [1542{1543"include": "#type-declarations"1544},1545{1546"match": "\\w+",1547"name": "entity.name.type.go"1548}1549]1550},1551"2": {1552"name": "punctuation.definition.begin.bracket.square.go"1553}1554},1555"end": "\\]",1556"endCaptures": {1557"0": {1558"name": "punctuation.definition.end.bracket.square.go"1559}1560},1561"patterns": [1562{1563"include": "#generic_param_types"1564}1565]1566},1567{1568"begin": "\\(",1569"beginCaptures": {1570"0": {1571"name": "punctuation.definition.begin.bracket.round.go"1572}1573},1574"end": "\\)",1575"endCaptures": {1576"0": {1577"name": "punctuation.definition.end.bracket.round.go"1578}1579},1580"patterns": [1581{1582"include": "#function_param_types"1583}1584]1585},1586{1587"comment": "other types",1588"match": "\\b([\\w\\.]+)",1589"captures": {1590"1": {1591"patterns": [1592{1593"include": "#type-declarations"1594},1595{1596"match": "\\w+",1597"name": "entity.name.type.go"1598}1599]1600}1601}1602},1603{1604"include": "$self"1605}1606]1607},1608"functions": {1609"comment": "Functions",1610"begin": "(\\bfunc\\b)(?=\\()",1611"beginCaptures": {1612"1": {1613"name": "keyword.function.go"1614}1615},1616"end": "(?:(?<=\\))(\\s*(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?((?:(?:\\s*(?:(?:[\\[\\]\\*]+)?[\\w\\.\\*]+)?(?:(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])|(?:\\((?:[^\\)]+)?\\)))?(?:[\\w\\.\\*]+)?)(?:\\s*)(?=\\{))|(?:\\s*(?:(?:(?:[\\[\\]\\*]+)?(?!\\bfunc\\b)(?:[\\w\\.\\*]+)(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])?(?:[\\w\\.\\*]+)?)|(?:\\((?:[^\\)]+)?\\)))))?)",1617"endCaptures": {1618"1": {1619"patterns": [1620{1621"include": "#type-declarations"1622}1623]1624},1625"2": {1626"patterns": [1627{1628"include": "#type-declarations-without-brackets"1629},1630{1631"include": "#parameter-variable-types"1632},1633{1634"match": "\\w+",1635"name": "entity.name.type.go"1636}1637]1638}1639},1640"patterns": [1641{1642"include": "#parameter-variable-types"1643}1644]1645},1646"functions_inline": {1647"comment": "functions in-line with multi return types",1648"match": "(?:(\\bfunc\\b)((?:\\((?:[^/]*?)\\))(?:\\s+)(?:\\((?:[^/]*?)\\)))(?:\\s+)(?=\\{))",1649"captures": {1650"1": {1651"name": "keyword.function.go"1652},1653"2": {1654"patterns": [1655{1656"include": "#type-declarations-without-brackets"1657},1658{1659"begin": "\\(",1660"beginCaptures": {1661"0": {1662"name": "punctuation.definition.begin.bracket.round.go"1663}1664},1665"end": "\\)",1666"endCaptures": {1667"0": {1668"name": "punctuation.definition.end.bracket.round.go"1669}1670},1671"patterns": [1672{1673"include": "#function_param_types"1674},1675{1676"include": "$self"1677}1678]1679},1680{1681"match": "\\[",1682"name": "punctuation.definition.begin.bracket.square.go"1683},1684{1685"match": "\\]",1686"name": "punctuation.definition.end.bracket.square.go"1687},1688{1689"match": "\\{",1690"name": "punctuation.definition.begin.bracket.curly.go"1691},1692{1693"match": "\\}",1694"name": "punctuation.definition.end.bracket.curly.go"1695},1696{1697"match": "\\w+",1698"name": "entity.name.type.go"1699}1700]1701}1702}1703},1704"support_functions": {1705"comment": "Support Functions",1706"match": "(?:(?:((?<=\\.)\\b\\w+)|(\\b\\w+))(?<brackets>\\[(?:[^\\[\\]]|\\g<brackets>)*\\])?(?=\\())",1707"captures": {1708"1": {1709"name": "entity.name.function.support.go"1710},1711"2": {1712"patterns": [1713{1714"include": "#type-declarations"1715},1716{1717"match": "\\d\\w*",1718"name": "invalid.illegal.identifier.go"1719},1720{1721"match": "\\w+",1722"name": "entity.name.function.support.go"1723}1724]1725},1726"3": {1727"patterns": [1728{1729"include": "#type-declarations-without-brackets"1730},1731{1732"match": "\\[",1733"name": "punctuation.definition.begin.bracket.square.go"1734},1735{1736"match": "\\]",1737"name": "punctuation.definition.end.bracket.square.go"1738},1739{1740"match": "\\{",1741"name": "punctuation.definition.begin.bracket.curly.go"1742},1743{1744"match": "\\}",1745"name": "punctuation.definition.end.bracket.curly.go"1746},1747{1748"match": "\\w+",1749"name": "entity.name.type.go"1750}1751]1752}1753}1754},1755"other_struct_interface_expressions": {1756"comment": "struct and interface expression in-line (before curly bracket)",1757"patterns": [1758{1759"comment": "after control variables must be added exactly here, do not move it! (changing may not affect tests, so be careful!)",1760"include": "#after_control_variables"1761},1762{1763"comment": "uses a named group to recursively match generic type with nested brackets, like 'Foo[A[B, C]]{}'",1764"match": "\\b(?!struct\\b|interface\\b)([\\w\\.]+)(?<brackets>\\[(?:[^\\[\\]]|\\g<brackets>)*\\])?(?=\\{)",1765"captures": {1766"1": {1767"patterns": [1768{1769"include": "#type-declarations"1770},1771{1772"match": "\\w+",1773"name": "entity.name.type.go"1774}1775]1776},1777"2": {1778"patterns": [1779{1780"include": "#type-declarations-without-brackets"1781},1782{1783"match": "\\[",1784"name": "punctuation.definition.begin.bracket.square.go"1785},1786{1787"match": "\\]",1788"name": "punctuation.definition.end.bracket.square.go"1789},1790{1791"match": "\\{",1792"name": "punctuation.definition.begin.bracket.curly.go"1793},1794{1795"match": "\\}",1796"name": "punctuation.definition.end.bracket.curly.go"1797},1798{1799"match": "\\w+",1800"name": "entity.name.type.go"1801}1802]1803}1804}1805}1806]1807},1808"type_assertion_inline": {1809"comment": "struct/interface types in-line (type assertion) | switch type keyword",1810"match": "(?:(?<=\\.\\()(?:(\\btype\\b)|((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\[\\]\\*]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?))(?=\\)))",1811"captures": {1812"1": {1813"name": "keyword.type.go"1814},1815"2": {1816"patterns": [1817{1818"include": "#type-declarations-without-brackets"1819},1820{1821"match": "\\(",1822"name": "punctuation.definition.begin.bracket.round.go"1823},1824{1825"match": "\\)",1826"name": "punctuation.definition.end.bracket.round.go"1827},1828{1829"match": "\\[",1830"name": "punctuation.definition.begin.bracket.square.go"1831},1832{1833"match": "\\]",1834"name": "punctuation.definition.end.bracket.square.go"1835},1836{1837"match": "\\{",1838"name": "punctuation.definition.begin.bracket.curly.go"1839},1840{1841"match": "\\}",1842"name": "punctuation.definition.end.bracket.curly.go"1843},1844{1845"match": "\\w+",1846"name": "entity.name.type.go"1847}1848]1849}1850}1851},1852"struct_variables_types": {1853"comment": "Struct variable type",1854"begin": "(\\bstruct\\b)\\s*(\\{)",1855"beginCaptures": {1856"1": {1857"name": "keyword.struct.go"1858},1859"2": {1860"name": "punctuation.definition.begin.bracket.curly.go"1861}1862},1863"patterns": [1864{1865"include": "#struct_variables_types_fields"1866},1867{1868"include": "$self"1869}1870],1871"end": "\\}",1872"endCaptures": {1873"0": {1874"name": "punctuation.definition.end.bracket.curly.go"1875}1876}1877},1878"struct_variables_types_fields": {1879"comment": "Struct variable type fields",1880"patterns": [1881{1882"include": "#struct_variable_types_fields_multi"1883},1884{1885"comment": "one line - single type",1886"match": "(?:(?<=\\{)\\s*((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]]+))\\s*(?=\\}))",1887"captures": {1888"1": {1889"patterns": [1890{1891"include": "#type-declarations"1892},1893{1894"match": "\\w+",1895"name": "entity.name.type.go"1896}1897]1898}1899}1900},1901{1902"comment": "one line - property variables and types",1903"match": "(?:(?<=\\{)\\s*((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]]+))\\s*(?=\\}))",1904"captures": {1905"1": {1906"patterns": [1907{1908"include": "#type-declarations"1909},1910{1911"match": "\\w+",1912"name": "variable.other.property.go"1913}1914]1915},1916"2": {1917"patterns": [1918{1919"include": "#type-declarations"1920},1921{1922"match": "\\w+",1923"name": "entity.name.type.go"1924}1925]1926}1927}1928},1929{1930"comment": "one line with semicolon(;) without formatting gofmt - single type | property variables and types",1931"match": "(?:(?<=\\{)((?:\\s*(?:(?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))?(?:(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[^\\s/]+)(?:\\;)?))+)\\s*(?=\\}))",1932"captures": {1933"1": {1934"patterns": [1935{1936"match": "(?:((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))?((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[^\\s/]+)(?:\\;)?))",1937"captures": {1938"1": {1939"patterns": [1940{1941"include": "#type-declarations"1942},1943{1944"match": "\\w+",1945"name": "variable.other.property.go"1946}1947]1948},1949"2": {1950"patterns": [1951{1952"include": "#type-declarations"1953},1954{1955"match": "\\w+",1956"name": "entity.name.type.go"1957}1958]1959}1960}1961}1962]1963}1964}1965},1966{1967"comment": "one type only",1968"match": "(?:((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*]+)\\s*)(?:(?=\\`|\\/|\")|$))",1969"captures": {1970"1": {1971"patterns": [1972{1973"include": "#type-declarations"1974},1975{1976"match": "\\w+",1977"name": "entity.name.type.go"1978}1979]1980}1981}1982},1983{1984"comment": "property variables and types",1985"match": "(\\b\\w+(?:\\s*\\,\\s*\\b\\w+)*)\\s*([^\\`\"\\/]+)",1986"captures": {1987"1": {1988"patterns": [1989{1990"include": "#type-declarations"1991},1992{1993"match": "\\w+",1994"name": "variable.other.property.go"1995}1996]1997},1998"2": {1999"patterns": [2000{2001"include": "#type-declarations-without-brackets"2002},2003{2004"include": "#parameter-variable-types"2005},2006{2007"match": "\\w+",2008"name": "entity.name.type.go"2009}2010]2011}2012}2013}2014]2015},2016"struct_variable_types_fields_multi": {2017"comment": "struct variable and type fields with multi lines",2018"patterns": [2019{2020"comment": "struct in struct types",2021"begin": "(?:((?:\\b\\w+(?:\\,\\s*\\b\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*)(?:[\\[\\]\\*]+)?)(\\bstruct\\b)(?:\\s*)(\\{))",2022"beginCaptures": {2023"1": {2024"patterns": [2025{2026"include": "#type-declarations"2027},2028{2029"match": "\\w+",2030"name": "variable.other.property.go"2031}2032]2033},2034"2": {2035"name": "keyword.struct.go"2036},2037"3": {2038"name": "punctuation.definition.begin.bracket.curly.go"2039}2040},2041"end": "\\}",2042"endCaptures": {2043"0": {2044"name": "punctuation.definition.end.bracket.curly.go"2045}2046},2047"patterns": [2048{2049"include": "#struct_variables_types_fields"2050},2051{2052"include": "$self"2053}2054]2055},2056{2057"comment": "interface in struct types",2058"begin": "(?:((?:\\b\\w+(?:\\,\\s*\\b\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*)(?:[\\[\\]\\*]+)?)(\\binterface\\b)(?:\\s*)(\\{))",2059"beginCaptures": {2060"1": {2061"patterns": [2062{2063"include": "#type-declarations"2064},2065{2066"match": "\\w+",2067"name": "variable.other.property.go"2068}2069]2070},2071"2": {2072"name": "keyword.interface.go"2073},2074"3": {2075"name": "punctuation.definition.begin.bracket.curly.go"2076}2077},2078"end": "\\}",2079"endCaptures": {2080"0": {2081"name": "punctuation.definition.end.bracket.curly.go"2082}2083},2084"patterns": [2085{2086"include": "#interface_variables_types_field"2087},2088{2089"include": "$self"2090}2091]2092},2093{2094"comment": "function in struct types",2095"begin": "(?:((?:\\b\\w+(?:\\,\\s*\\b\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:\\s*)(?:[\\[\\]\\*]+)?)(\\bfunc\\b)(?:\\s*)(\\())",2096"beginCaptures": {2097"1": {2098"patterns": [2099{2100"include": "#type-declarations"2101},2102{2103"match": "\\w+",2104"name": "variable.other.property.go"2105}2106]2107},2108"2": {2109"name": "keyword.function.go"2110},2111"3": {2112"name": "punctuation.definition.begin.bracket.round.go"2113}2114},2115"end": "\\)",2116"endCaptures": {2117"0": {2118"name": "punctuation.definition.end.bracket.round.go"2119}2120},2121"patterns": [2122{2123"include": "#function_param_types"2124},2125{2126"include": "$self"2127}2128]2129},2130{2131"include": "#parameter-variable-types"2132}2133]2134},2135"interface_variables_types": {2136"comment": "interface variable types",2137"begin": "(\\binterface\\b)\\s*(\\{)",2138"beginCaptures": {2139"1": {2140"name": "keyword.interface.go"2141},2142"2": {2143"name": "punctuation.definition.begin.bracket.curly.go"2144}2145},2146"patterns": [2147{2148"include": "#interface_variables_types_field"2149},2150{2151"include": "$self"2152}2153],2154"end": "\\}",2155"endCaptures": {2156"0": {2157"name": "punctuation.definition.end.bracket.curly.go"2158}2159}2160},2161"interface_variables_types_field": {2162"comment": "interface variable type fields",2163"patterns": [2164{2165"include": "#support_functions"2166},2167{2168"include": "#type-declarations-without-brackets"2169},2170{2171"begin": "([\\w\\.\\*]+)?(\\[)",2172"beginCaptures": {2173"1": {2174"patterns": [2175{2176"include": "#type-declarations"2177},2178{2179"match": "\\w+",2180"name": "entity.name.type.go"2181}2182]2183},2184"2": {2185"name": "punctuation.definition.begin.bracket.square.go"2186}2187},2188"end": "\\]",2189"endCaptures": {2190"0": {2191"name": "punctuation.definition.end.bracket.square.go"2192}2193},2194"patterns": [2195{2196"include": "#generic_param_types"2197}2198]2199},2200{2201"begin": "\\(",2202"beginCaptures": {2203"0": {2204"name": "punctuation.definition.begin.bracket.round.go"2205}2206},2207"end": "\\)",2208"endCaptures": {2209"0": {2210"name": "punctuation.definition.end.bracket.round.go"2211}2212},2213"patterns": [2214{2215"include": "#function_param_types"2216}2217]2218},2219{2220"comment": "other types",2221"match": "([\\w\\.]+)",2222"captures": {2223"1": {2224"patterns": [2225{2226"include": "#type-declarations"2227},2228{2229"match": "\\w+",2230"name": "entity.name.type.go"2231}2232]2233}2234}2235}2236]2237},2238"single_type": {2239"patterns": [2240{2241"comment": "single type declaration",2242"match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?:\\s+)(?!(?:\\=\\s*)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b)([\\s\\S]+))",2243"captures": {2244"1": {2245"name": "keyword.type.go"2246},2247"2": {2248"patterns": [2249{2250"include": "#type-declarations"2251},2252{2253"match": "\\w+",2254"name": "entity.name.type.go"2255}2256]2257},2258"3": {2259"patterns": [2260{2261"begin": "\\(",2262"beginCaptures": {2263"0": {2264"name": "punctuation.definition.begin.bracket.round.go"2265}2266},2267"end": "\\)",2268"endCaptures": {2269"0": {2270"name": "punctuation.definition.end.bracket.round.go"2271}2272},2273"patterns": [2274{2275"include": "#function_param_types"2276},2277{2278"include": "$self"2279}2280]2281},2282{2283"include": "#type-declarations"2284},2285{2286"include": "#generic_types"2287},2288{2289"match": "\\w+",2290"name": "entity.name.type.go"2291}2292]2293}2294}2295},2296{2297"comment": "single type declaration with generics",2298"begin": "(?:(?:^|\\s+)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?=\\[))",2299"beginCaptures": {2300"1": {2301"name": "keyword.type.go"2302},2303"2": {2304"patterns": [2305{2306"include": "#type-declarations-without-brackets"2307},2308{2309"match": "\\w+",2310"name": "entity.name.type.go"2311}2312]2313}2314},2315"end": "(?:(?<=\\])((?:\\s+)(?:\\=\\s*)?(?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b|\\bfunc\\b))[\\w\\.\\-\\*\\[\\]]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*))?)",2316"endCaptures": {2317"1": {2318"patterns": [2319{2320"include": "#type-declarations-without-brackets"2321},2322{2323"match": "\\[",2324"name": "punctuation.definition.begin.bracket.square.go"2325},2326{2327"match": "\\]",2328"name": "punctuation.definition.end.bracket.square.go"2329},2330{2331"match": "\\w+",2332"name": "entity.name.type.go"2333}2334]2335}2336},2337"patterns": [2338{2339"include": "#struct_variables_types"2340},2341{2342"include": "#type-declarations-without-brackets"2343},2344{2345"include": "#parameter-variable-types"2346},2347{2348"match": "\\[",2349"name": "punctuation.definition.begin.bracket.square.go"2350},2351{2352"match": "\\]",2353"name": "punctuation.definition.end.bracket.square.go"2354},2355{2356"match": "\\{",2357"name": "punctuation.definition.begin.bracket.curly.go"2358},2359{2360"match": "\\}",2361"name": "punctuation.definition.end.bracket.curly.go"2362},2363{2364"match": "\\(",2365"name": "punctuation.definition.begin.bracket.round.go"2366},2367{2368"match": "\\)",2369"name": "punctuation.definition.end.bracket.round.go"2370},2371{2372"match": "\\w+",2373"name": "entity.name.type.go"2374}2375]2376}2377]2378},2379"multi_types": {2380"comment": "multi type declaration",2381"begin": "(\\btype\\b)\\s*(\\()",2382"beginCaptures": {2383"1": {2384"name": "keyword.type.go"2385},2386"2": {2387"name": "punctuation.definition.begin.bracket.round.go"2388}2389},2390"patterns": [2391{2392"include": "#struct_variables_types"2393},2394{2395"include": "#interface_variables_types"2396},2397{2398"include": "#type-declarations-without-brackets"2399},2400{2401"include": "#parameter-variable-types"2402},2403{2404"match": "\\w+",2405"name": "entity.name.type.go"2406}2407],2408"end": "\\)",2409"endCaptures": {2410"0": {2411"name": "punctuation.definition.end.bracket.round.go"2412}2413}2414},2415"after_control_variables": {2416"comment": "After control variables, to not highlight as a struct/interface (before formatting with gofmt)",2417"match": "(?:(?<=\\brange\\b|\\;|\\bif\\b|\\bfor\\b|\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)|\\w(?:\\+|/|\\-|\\*|\\%)\\=|\\|\\||\\&\\&)(?:\\s*)((?![\\[\\]]+)[[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))",2418"captures": {2419"1": {2420"patterns": [2421{2422"include": "#type-declarations-without-brackets"2423},2424{2425"match": "\\[",2426"name": "punctuation.definition.begin.bracket.square.go"2427},2428{2429"match": "\\]",2430"name": "punctuation.definition.end.bracket.square.go"2431},2432{2433"match": "\\w+",2434"name": "variable.other.go"2435}2436]2437}2438}2439},2440"syntax_errors": {2441"patterns": [2442{2443"comment": "Syntax error using slices",2444"match": "\\[\\](\\s+)",2445"captures": {2446"1": {2447"name": "invalid.illegal.slice.go"2448}2449}2450},2451{2452"comment": "Syntax error numeric literals",2453"match": "\\b0[0-7]*[89]\\d*\\b",2454"name": "invalid.illegal.numeric.go"2455}2456]2457},2458"built_in_functions": {2459"comment": "Built-in functions",2460"patterns": [2461{2462"match": "\\b(append|cap|close|complex|copy|delete|imag|len|panic|print|println|real|recover|min|max|clear)\\b(?=\\()",2463"name": "entity.name.function.support.builtin.go"2464},2465{2466"comment": "new keyword",2467"begin": "(\\bnew\\b)(\\()",2468"beginCaptures": {2469"1": {2470"name": "entity.name.function.support.builtin.go"2471},2472"2": {2473"name": "punctuation.definition.begin.bracket.round.go"2474}2475},2476"end": "\\)",2477"endCaptures": {2478"0": {2479"name": "punctuation.definition.end.bracket.round.go"2480}2481},2482"patterns": [2483{2484"include": "#functions"2485},2486{2487"include": "#struct_variables_types"2488},2489{2490"include": "#type-declarations"2491},2492{2493"include": "#generic_types"2494},2495{2496"match": "\\w+",2497"name": "entity.name.type.go"2498},2499{2500"include": "$self"2501}2502]2503},2504{2505"comment": "make keyword",2506"begin": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?:[\\[\\]\\*]+)?(?:(?!\\bmap\\b)(?:[\\w\\.]+))?(\\[(?:(?:[\\S]+)(?:(?:\\,\\s*(?:[\\S]+))*))?\\])?(?:\\,)?)?))",2507"beginCaptures": {2508"1": {2509"name": "entity.name.function.support.builtin.go"2510},2511"2": {2512"name": "punctuation.definition.begin.bracket.round.go"2513},2514"3": {2515"patterns": [2516{2517"include": "#type-declarations-without-brackets"2518},2519{2520"include": "#parameter-variable-types"2521},2522{2523"match": "\\w+",2524"name": "entity.name.type.go"2525}2526]2527}2528},2529"end": "\\)",2530"endCaptures": {2531"0": {2532"name": "punctuation.definition.end.bracket.round.go"2533}2534},2535"patterns": [2536{2537"include": "$self"2538}2539]2540}2541]2542},2543"struct_interface_declaration": {2544"comment": "struct, interface type declarations (related to: struct_variables_types, interface_variables_types)",2545"match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.]+))",2546"captures": {2547"1": {2548"name": "keyword.type.go"2549},2550"2": {2551"patterns": [2552{2553"include": "#type-declarations"2554},2555{2556"match": "\\w+",2557"name": "entity.name.type.go"2558}2559]2560}2561}2562},2563"switch_types": {2564"comment": "switch type assertions, only highlights types after case keyword",2565"begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*\\:\\=)?\\s*([\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)",2566"beginCaptures": {2567"1": {2568"patterns": [2569{2570"include": "#operators"2571},2572{2573"match": "\\w+",2574"name": "variable.other.assignment.go"2575}2576]2577},2578"2": {2579"patterns": [2580{2581"include": "#support_functions"2582},2583{2584"include": "#type-declarations"2585},2586{2587"match": "\\w+",2588"name": "variable.other.go"2589}2590]2591},2592"3": {2593"patterns": [2594{2595"include": "#delimiters"2596},2597{2598"include": "#brackets"2599},2600{2601"match": "\\btype\\b",2602"name": "keyword.type.go"2603}2604]2605},2606"4": {2607"name": "punctuation.definition.begin.bracket.curly.go"2608}2609},2610"end": "\\}",2611"endCaptures": {2612"0": {2613"name": "punctuation.definition.end.bracket.curly.go"2614}2615},2616"patterns": [2617{2618"comment": "types after case keyword with single line",2619"match": "(?:^\\s*(\\bcase\\b))(?:\\s+)([\\w\\.\\,\\*\\=\\<\\>\\!\\s]+)(:)(\\s*/(?:/|\\*)\\s*.*)?$",2620"captures": {2621"1": {2622"name": "keyword.control.go"2623},2624"2": {2625"patterns": [2626{2627"include": "#type-declarations"2628},2629{2630"match": "\\w+",2631"name": "entity.name.type.go"2632}2633]2634},2635"3": {2636"name": "punctuation.other.colon.go"2637},2638"4": {2639"patterns": [2640{2641"include": "#comments"2642}2643]2644}2645}2646},2647{2648"comment": "types after case keyword with multi lines",2649"begin": "\\bcase\\b",2650"beginCaptures": {2651"0": {2652"name": "keyword.control.go"2653}2654},2655"end": "\\:",2656"endCaptures": {2657"0": {2658"name": "punctuation.other.colon.go"2659}2660},2661"patterns": [2662{2663"include": "#type-declarations"2664},2665{2666"match": "\\w+",2667"name": "entity.name.type.go"2668}2669]2670},2671{2672"include": "$self"2673}2674]2675},2676"switch_variables": {2677"comment": "variables after case control keyword in switch/select expression, to not scope them as property variables",2678"patterns": [2679{2680"comment": "single line",2681"match": "(?:(?:^\\s*(\\bcase\\b))(?:\\s+)([\\s\\S]+(?:\\:)\\s*(?:/(?:/|\\*).*)?)$)",2682"captures": {2683"1": {2684"name": "keyword.control.go"2685},2686"2": {2687"patterns": [2688{2689"include": "#type-declarations"2690},2691{2692"include": "#support_functions"2693},2694{2695"include": "#variable_assignment"2696},2697{2698"match": "\\w+",2699"name": "variable.other.go"2700}2701]2702}2703}2704},2705{2706"comment": "multi lines",2707"begin": "(?<=\\bswitch\\b)(?:\\s*)((?:[\\w\\.]+(?:\\s*(?:[\\:\\=\\!\\,\\+/\\-\\%\\<\\>\\|\\&]+)\\s*[\\w\\.]+)*\\s*(?:[\\:\\=\\!\\,\\+/\\-\\%\\<\\>\\|\\&]+))?(?:\\s*(?:[\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+)?\\s*(?:\\;\\s*(?:[\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+)\\s*)?))(\\{)",2708"beginCaptures": {2709"1": {2710"patterns": [2711{2712"include": "#support_functions"2713},2714{2715"include": "#type-declarations"2716},2717{2718"include": "#variable_assignment"2719},2720{2721"match": "\\w+",2722"name": "variable.other.go"2723}2724]2725},2726"2": {2727"name": "punctuation.definition.begin.bracket.curly.go"2728}2729},2730"end": "\\}",2731"endCaptures": {2732"0": {2733"name": "punctuation.definition.end.bracket.curly.go"2734}2735},2736"patterns": [2737{2738"begin": "\\bcase\\b",2739"beginCaptures": {2740"0": {2741"name": "keyword.control.go"2742}2743},2744"end": "\\:",2745"endCaptures": {2746"0": {2747"name": "punctuation.other.colon.go"2748}2749},2750"patterns": [2751{2752"include": "#support_functions"2753},2754{2755"include": "#type-declarations"2756},2757{2758"include": "#variable_assignment"2759},2760{2761"match": "\\w+",2762"name": "variable.other.go"2763}2764]2765},2766{2767"include": "$self"2768}2769]2770}2771]2772},2773"var_assignment": {2774"comment": "variable assignment with var keyword",2775"patterns": [2776{2777"comment": "single assignment",2778"match": "(?:(?<=\\bvar\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2779"captures": {2780"1": {2781"patterns": [2782{2783"include": "#delimiters"2784},2785{2786"match": "\\w+",2787"name": "variable.other.assignment.go"2788}2789]2790},2791"2": {2792"patterns": [2793{2794"include": "#type-declarations-without-brackets"2795},2796{2797"include": "#generic_types"2798},2799{2800"match": "\\(",2801"name": "punctuation.definition.begin.bracket.round.go"2802},2803{2804"match": "\\)",2805"name": "punctuation.definition.end.bracket.round.go"2806},2807{2808"match": "\\[",2809"name": "punctuation.definition.begin.bracket.square.go"2810},2811{2812"match": "\\]",2813"name": "punctuation.definition.end.bracket.square.go"2814},2815{2816"match": "\\w+",2817"name": "entity.name.type.go"2818}2819]2820}2821}2822},2823{2824"comment": "multi assignment",2825"begin": "(?:(?<=\\bvar\\b)(?:\\s*)(\\())",2826"beginCaptures": {2827"1": {2828"name": "punctuation.definition.begin.bracket.round.go"2829}2830},2831"end": "\\)",2832"endCaptures": {2833"0": {2834"name": "punctuation.definition.end.bracket.round.go"2835}2836},2837"patterns": [2838{2839"match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2840"captures": {2841"1": {2842"patterns": [2843{2844"include": "#delimiters"2845},2846{2847"match": "\\w+",2848"name": "variable.other.assignment.go"2849}2850]2851},2852"2": {2853"patterns": [2854{2855"include": "#type-declarations-without-brackets"2856},2857{2858"include": "#generic_types"2859},2860{2861"match": "\\(",2862"name": "punctuation.definition.begin.bracket.round.go"2863},2864{2865"match": "\\)",2866"name": "punctuation.definition.end.bracket.round.go"2867},2868{2869"match": "\\[",2870"name": "punctuation.definition.begin.bracket.square.go"2871},2872{2873"match": "\\]",2874"name": "punctuation.definition.end.bracket.square.go"2875},2876{2877"match": "\\w+",2878"name": "entity.name.type.go"2879}2880]2881}2882}2883},2884{2885"include": "$self"2886}2887]2888}2889]2890},2891"const_assignment": {2892"comment": "constant assignment with const keyword",2893"patterns": [2894{2895"comment": "single assignment",2896"match": "(?:(?<=\\bconst\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2897"captures": {2898"1": {2899"patterns": [2900{2901"include": "#delimiters"2902},2903{2904"match": "\\w+",2905"name": "variable.other.constant.go"2906}2907]2908},2909"2": {2910"patterns": [2911{2912"include": "#type-declarations-without-brackets"2913},2914{2915"include": "#generic_types"2916},2917{2918"match": "\\(",2919"name": "punctuation.definition.begin.bracket.round.go"2920},2921{2922"match": "\\)",2923"name": "punctuation.definition.end.bracket.round.go"2924},2925{2926"match": "\\[",2927"name": "punctuation.definition.begin.bracket.square.go"2928},2929{2930"match": "\\]",2931"name": "punctuation.definition.end.bracket.square.go"2932},2933{2934"match": "\\w+",2935"name": "entity.name.type.go"2936}2937]2938}2939}2940},2941{2942"comment": "multi assignment",2943"begin": "(?:(?<=\\bconst\\b)(?:\\s*)(\\())",2944"beginCaptures": {2945"1": {2946"name": "punctuation.definition.begin.bracket.round.go"2947}2948},2949"end": "\\)",2950"endCaptures": {2951"0": {2952"name": "punctuation.definition.end.bracket.round.go"2953}2954},2955"patterns": [2956{2957"match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2958"captures": {2959"1": {2960"patterns": [2961{2962"include": "#delimiters"2963},2964{2965"match": "\\w+",2966"name": "variable.other.constant.go"2967}2968]2969},2970"2": {2971"patterns": [2972{2973"include": "#type-declarations-without-brackets"2974},2975{2976"include": "#generic_types"2977},2978{2979"match": "\\(",2980"name": "punctuation.definition.begin.bracket.round.go"2981},2982{2983"match": "\\)",2984"name": "punctuation.definition.end.bracket.round.go"2985},2986{2987"match": "\\[",2988"name": "punctuation.definition.begin.bracket.square.go"2989},2990{2991"match": "\\]",2992"name": "punctuation.definition.end.bracket.square.go"2993},2994{2995"match": "\\w+",2996"name": "entity.name.type.go"2997}2998]2999}3000}3001},3002{3003"include": "$self"3004}3005]3006}3007]3008},3009"variable_assignment": {3010"comment": "variable assignment",3011"patterns": [3012{3013"comment": "variable assignment with :=",3014"match": "\\b\\w+(?:\\,\\s*\\w+)*(?=\\s*:=)",3015"captures": {3016"0": {3017"patterns": [3018{3019"include": "#delimiters"3020},3021{3022"match": "\\d\\w*",3023"name": "invalid.illegal.identifier.go"3024},3025{3026"match": "\\w+",3027"name": "variable.other.assignment.go"3028}3029]3030}3031}3032},3033{3034"comment": "variable assignment with =",3035"match": "\\b[\\w\\.\\*]+(?:\\,\\s*[\\w\\.\\*]+)*(?=\\s*=(?!=))",3036"captures": {3037"0": {3038"patterns": [3039{3040"include": "#delimiters"3041},3042{3043"include": "#operators"3044},3045{3046"match": "\\d\\w*",3047"name": "invalid.illegal.identifier.go"3048},3049{3050"match": "\\w+",3051"name": "variable.other.assignment.go"3052}3053]3054}3055}3056}3057]3058},3059"generic_types": {3060"comment": "Generic support for all types",3061"match": "(?:([\\w\\.\\*]+)(\\[(?:[^\\]]+)?\\]))",3062"captures": {3063"1": {3064"patterns": [3065{3066"include": "#type-declarations"3067},3068{3069"match": "\\w+",3070"name": "entity.name.type.go"3071}3072]3073},3074"2": {3075"patterns": [3076{3077"include": "#parameter-variable-types"3078}3079]3080}3081}3082},3083"slice_index_variables": {3084"comment": "slice index and capacity variables, to not scope them as property variables",3085"match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?)(?=\\])",3086"captures": {3087"1": {3088"patterns": [3089{3090"include": "#type-declarations"3091},3092{3093"match": "\\w+",3094"name": "variable.other.go"3095}3096]3097}3098}3099},3100"property_variables": {3101"comment": "Property variables in struct",3102"match": "((?:\\b[\\w\\.]+)(?:\\:(?!\\=)))",3103"captures": {3104"1": {3105"patterns": [3106{3107"include": "#type-declarations"3108},3109{3110"match": "\\w+",3111"name": "variable.other.property.go"3112}3113]3114}3115}3116},3117"label_loop_variables": {3118"comment": "labeled loop variable name",3119"match": "((?:^\\s*\\w+:\\s*$)|(?:^\\s*(?:\\bbreak\\b|\\bgoto\\b|\\bcontinue\\b)\\s+\\w+(?:\\s*/(?:/|\\*)\\s*.*)?$))",3120"captures": {3121"1": {3122"patterns": [3123{3124"include": "#type-declarations"3125},3126{3127"match": "\\w+",3128"name": "variable.other.label.go"3129}3130]3131}3132}3133},3134"double_parentheses_types": {3135"comment": "double parentheses types",3136"match": "(?:(?<!\\w)(\\((?:[\\[\\]\\*]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?\\))(?=\\())",3137"captures": {3138"1": {3139"patterns": [3140{3141"include": "#type-declarations-without-brackets"3142},3143{3144"match": "\\(",3145"name": "punctuation.definition.begin.bracket.round.go"3146},3147{3148"match": "\\)",3149"name": "punctuation.definition.end.bracket.round.go"3150},3151{3152"match": "\\[",3153"name": "punctuation.definition.begin.bracket.square.go"3154},3155{3156"match": "\\]",3157"name": "punctuation.definition.end.bracket.square.go"3158},3159{3160"match": "\\{",3161"name": "punctuation.definition.begin.bracket.curly.go"3162},3163{3164"match": "\\}",3165"name": "punctuation.definition.end.bracket.curly.go"3166},3167{3168"match": "\\w+",3169"name": "entity.name.type.go"3170}3171]3172}3173}3174},3175"hover": {3176"comment": "hovering with the mouse",3177"patterns": [3178{3179"comment": "struct field property and types when hovering with the mouse",3180"match": "(?:(?<=^\\bfield\\b)\\s+([\\w\\*\\.]+)\\s+([\\s\\S]+))",3181"captures": {3182"1": {3183"patterns": [3184{3185"include": "#type-declarations"3186},3187{3188"match": "\\w+",3189"name": "variable.other.property.go"3190}3191]3192},3193"2": {3194"patterns": [3195{3196"match": "\\binvalid\\b\\s+\\btype\\b",3197"name": "invalid.field.go"3198},3199{3200"include": "#type-declarations-without-brackets"3201},3202{3203"include": "#parameter-variable-types"3204},3205{3206"match": "\\w+",3207"name": "entity.name.type.go"3208}3209]3210}3211}3212},3213{3214"comment": "return types when hovering with the mouse",3215"match": "(?:(?<=^\\breturns\\b)\\s+([\\s\\S]+))",3216"captures": {3217"1": {3218"patterns": [3219{3220"include": "#type-declarations-without-brackets"3221},3222{3223"include": "#parameter-variable-types"3224},3225{3226"match": "\\w+",3227"name": "entity.name.type.go"3228}3229]3230}3231}3232}3233]3234},3235"other_variables": {3236"comment": "all other variables",3237"match": "\\w+",3238"name": "variable.other.go"3239}3240}3241}32423243