Path: blob/main/extensions/go/syntaxes/go.tmLanguage.json
5238 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/6e8421faf8f1445512825f63925e54a62106bcf1",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": "#support_functions"2491},2492{2493"include": "#type-declarations"2494},2495{2496"include": "#generic_types"2497},2498{2499"match": "\\w+",2500"name": "entity.name.type.go"2501},2502{2503"include": "$self"2504}2505]2506},2507{2508"comment": "make keyword",2509"begin": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?:[\\[\\]\\*]+)?(?:(?!\\bmap\\b)(?:[\\w\\.]+))?(\\[(?:(?:[\\S]+)(?:(?:\\,\\s*(?:[\\S]+))*))?\\])?(?:\\,)?)?))",2510"beginCaptures": {2511"1": {2512"name": "entity.name.function.support.builtin.go"2513},2514"2": {2515"name": "punctuation.definition.begin.bracket.round.go"2516},2517"3": {2518"patterns": [2519{2520"include": "#type-declarations-without-brackets"2521},2522{2523"include": "#parameter-variable-types"2524},2525{2526"match": "\\w+",2527"name": "entity.name.type.go"2528}2529]2530}2531},2532"end": "\\)",2533"endCaptures": {2534"0": {2535"name": "punctuation.definition.end.bracket.round.go"2536}2537},2538"patterns": [2539{2540"include": "$self"2541}2542]2543}2544]2545},2546"struct_interface_declaration": {2547"comment": "struct, interface type declarations (related to: struct_variables_types, interface_variables_types)",2548"match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.]+))",2549"captures": {2550"1": {2551"name": "keyword.type.go"2552},2553"2": {2554"patterns": [2555{2556"include": "#type-declarations"2557},2558{2559"match": "\\w+",2560"name": "entity.name.type.go"2561}2562]2563}2564}2565},2566"switch_types": {2567"comment": "switch type assertions, only highlights types after case keyword",2568"begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*\\:\\=)?\\s*([\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)",2569"beginCaptures": {2570"1": {2571"patterns": [2572{2573"include": "#operators"2574},2575{2576"match": "\\w+",2577"name": "variable.other.assignment.go"2578}2579]2580},2581"2": {2582"patterns": [2583{2584"include": "#support_functions"2585},2586{2587"include": "#type-declarations"2588},2589{2590"match": "\\w+",2591"name": "variable.other.go"2592}2593]2594},2595"3": {2596"patterns": [2597{2598"include": "#delimiters"2599},2600{2601"include": "#brackets"2602},2603{2604"match": "\\btype\\b",2605"name": "keyword.type.go"2606}2607]2608},2609"4": {2610"name": "punctuation.definition.begin.bracket.curly.go"2611}2612},2613"end": "\\}",2614"endCaptures": {2615"0": {2616"name": "punctuation.definition.end.bracket.curly.go"2617}2618},2619"patterns": [2620{2621"comment": "types after case keyword with single line",2622"match": "(?:^\\s*(\\bcase\\b))(?:\\s+)([\\w\\.\\,\\*\\=\\<\\>\\!\\s]+)(:)(\\s*/(?:/|\\*)\\s*.*)?$",2623"captures": {2624"1": {2625"name": "keyword.control.go"2626},2627"2": {2628"patterns": [2629{2630"include": "#type-declarations"2631},2632{2633"match": "\\w+",2634"name": "entity.name.type.go"2635}2636]2637},2638"3": {2639"name": "punctuation.other.colon.go"2640},2641"4": {2642"patterns": [2643{2644"include": "#comments"2645}2646]2647}2648}2649},2650{2651"comment": "types after case keyword with multi lines",2652"begin": "\\bcase\\b",2653"beginCaptures": {2654"0": {2655"name": "keyword.control.go"2656}2657},2658"end": "\\:",2659"endCaptures": {2660"0": {2661"name": "punctuation.other.colon.go"2662}2663},2664"patterns": [2665{2666"include": "#type-declarations"2667},2668{2669"match": "\\w+",2670"name": "entity.name.type.go"2671}2672]2673},2674{2675"include": "$self"2676}2677]2678},2679"switch_variables": {2680"comment": "variables after case control keyword in switch/select expression, to not scope them as property variables",2681"patterns": [2682{2683"comment": "single line",2684"match": "(?:(?:^\\s*(\\bcase\\b))(?:\\s+)([\\s\\S]+(?:\\:)\\s*(?:/(?:/|\\*).*)?)$)",2685"captures": {2686"1": {2687"name": "keyword.control.go"2688},2689"2": {2690"patterns": [2691{2692"include": "#type-declarations"2693},2694{2695"include": "#support_functions"2696},2697{2698"include": "#variable_assignment"2699},2700{2701"match": "\\w+",2702"name": "variable.other.go"2703}2704]2705}2706}2707},2708{2709"comment": "multi lines",2710"begin": "(?<=\\bswitch\\b)(?:\\s*)((?:[\\w\\.]+(?:\\s*(?:[\\:\\=\\!\\,\\+/\\-\\%\\<\\>\\|\\&]+)\\s*[\\w\\.]+)*\\s*(?:[\\:\\=\\!\\,\\+/\\-\\%\\<\\>\\|\\&]+))?(?:\\s*(?:[\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+)?\\s*(?:\\;\\s*(?:[\\w\\.\\*\\(\\)\\[\\]\\+/\\-\\%\\<\\>\\|\\&]+)\\s*)?))(\\{)",2711"beginCaptures": {2712"1": {2713"patterns": [2714{2715"include": "#support_functions"2716},2717{2718"include": "#type-declarations"2719},2720{2721"include": "#variable_assignment"2722},2723{2724"match": "\\w+",2725"name": "variable.other.go"2726}2727]2728},2729"2": {2730"name": "punctuation.definition.begin.bracket.curly.go"2731}2732},2733"end": "\\}",2734"endCaptures": {2735"0": {2736"name": "punctuation.definition.end.bracket.curly.go"2737}2738},2739"patterns": [2740{2741"begin": "\\bcase\\b",2742"beginCaptures": {2743"0": {2744"name": "keyword.control.go"2745}2746},2747"end": "\\:",2748"endCaptures": {2749"0": {2750"name": "punctuation.other.colon.go"2751}2752},2753"patterns": [2754{2755"include": "#support_functions"2756},2757{2758"include": "#type-declarations"2759},2760{2761"include": "#variable_assignment"2762},2763{2764"match": "\\w+",2765"name": "variable.other.go"2766}2767]2768},2769{2770"include": "$self"2771}2772]2773}2774]2775},2776"var_assignment": {2777"comment": "variable assignment with var keyword",2778"patterns": [2779{2780"comment": "single assignment",2781"match": "(?:(?<=\\bvar\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2782"captures": {2783"1": {2784"patterns": [2785{2786"include": "#delimiters"2787},2788{2789"match": "\\w+",2790"name": "variable.other.assignment.go"2791}2792]2793},2794"2": {2795"patterns": [2796{2797"include": "#type-declarations-without-brackets"2798},2799{2800"include": "#generic_types"2801},2802{2803"match": "\\(",2804"name": "punctuation.definition.begin.bracket.round.go"2805},2806{2807"match": "\\)",2808"name": "punctuation.definition.end.bracket.round.go"2809},2810{2811"match": "\\[",2812"name": "punctuation.definition.begin.bracket.square.go"2813},2814{2815"match": "\\]",2816"name": "punctuation.definition.end.bracket.square.go"2817},2818{2819"match": "\\w+",2820"name": "entity.name.type.go"2821}2822]2823}2824}2825},2826{2827"comment": "multi assignment",2828"begin": "(?:(?<=\\bvar\\b)(?:\\s*)(\\())",2829"beginCaptures": {2830"1": {2831"name": "punctuation.definition.begin.bracket.round.go"2832}2833},2834"end": "\\)",2835"endCaptures": {2836"0": {2837"name": "punctuation.definition.end.bracket.round.go"2838}2839},2840"patterns": [2841{2842"match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2843"captures": {2844"1": {2845"patterns": [2846{2847"include": "#delimiters"2848},2849{2850"match": "\\w+",2851"name": "variable.other.assignment.go"2852}2853]2854},2855"2": {2856"patterns": [2857{2858"include": "#type-declarations-without-brackets"2859},2860{2861"include": "#generic_types"2862},2863{2864"match": "\\(",2865"name": "punctuation.definition.begin.bracket.round.go"2866},2867{2868"match": "\\)",2869"name": "punctuation.definition.end.bracket.round.go"2870},2871{2872"match": "\\[",2873"name": "punctuation.definition.begin.bracket.square.go"2874},2875{2876"match": "\\]",2877"name": "punctuation.definition.end.bracket.square.go"2878},2879{2880"match": "\\w+",2881"name": "entity.name.type.go"2882}2883]2884}2885}2886},2887{2888"include": "$self"2889}2890]2891}2892]2893},2894"const_assignment": {2895"comment": "constant assignment with const keyword",2896"patterns": [2897{2898"comment": "single assignment",2899"match": "(?:(?<=\\bconst\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2900"captures": {2901"1": {2902"patterns": [2903{2904"include": "#delimiters"2905},2906{2907"match": "\\w+",2908"name": "variable.other.constant.go"2909}2910]2911},2912"2": {2913"patterns": [2914{2915"include": "#type-declarations-without-brackets"2916},2917{2918"include": "#generic_types"2919},2920{2921"match": "\\(",2922"name": "punctuation.definition.begin.bracket.round.go"2923},2924{2925"match": "\\)",2926"name": "punctuation.definition.end.bracket.round.go"2927},2928{2929"match": "\\[",2930"name": "punctuation.definition.begin.bracket.square.go"2931},2932{2933"match": "\\]",2934"name": "punctuation.definition.end.bracket.square.go"2935},2936{2937"match": "\\w+",2938"name": "entity.name.type.go"2939}2940]2941}2942}2943},2944{2945"comment": "multi assignment",2946"begin": "(?:(?<=\\bconst\\b)(?:\\s*)(\\())",2947"beginCaptures": {2948"1": {2949"name": "punctuation.definition.begin.bracket.round.go"2950}2951},2952"end": "\\)",2953"endCaptures": {2954"0": {2955"name": "punctuation.definition.end.bracket.round.go"2956}2957},2958"patterns": [2959{2960"match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)",2961"captures": {2962"1": {2963"patterns": [2964{2965"include": "#delimiters"2966},2967{2968"match": "\\w+",2969"name": "variable.other.constant.go"2970}2971]2972},2973"2": {2974"patterns": [2975{2976"include": "#type-declarations-without-brackets"2977},2978{2979"include": "#generic_types"2980},2981{2982"match": "\\(",2983"name": "punctuation.definition.begin.bracket.round.go"2984},2985{2986"match": "\\)",2987"name": "punctuation.definition.end.bracket.round.go"2988},2989{2990"match": "\\[",2991"name": "punctuation.definition.begin.bracket.square.go"2992},2993{2994"match": "\\]",2995"name": "punctuation.definition.end.bracket.square.go"2996},2997{2998"match": "\\w+",2999"name": "entity.name.type.go"3000}3001]3002}3003}3004},3005{3006"include": "$self"3007}3008]3009}3010]3011},3012"variable_assignment": {3013"comment": "variable assignment",3014"patterns": [3015{3016"comment": "variable assignment with :=",3017"match": "\\b\\w+(?:\\,\\s*\\w+)*(?=\\s*:=)",3018"captures": {3019"0": {3020"patterns": [3021{3022"include": "#delimiters"3023},3024{3025"match": "\\d\\w*",3026"name": "invalid.illegal.identifier.go"3027},3028{3029"match": "\\w+",3030"name": "variable.other.assignment.go"3031}3032]3033}3034}3035},3036{3037"comment": "variable assignment with =",3038"match": "\\b[\\w\\.\\*]+(?:\\,\\s*[\\w\\.\\*]+)*(?=\\s*=(?!=))",3039"captures": {3040"0": {3041"patterns": [3042{3043"include": "#delimiters"3044},3045{3046"include": "#operators"3047},3048{3049"match": "\\d\\w*",3050"name": "invalid.illegal.identifier.go"3051},3052{3053"match": "\\w+",3054"name": "variable.other.assignment.go"3055}3056]3057}3058}3059}3060]3061},3062"generic_types": {3063"comment": "Generic support for all types",3064"match": "(?:([\\w\\.\\*]+)(\\[(?:[^\\]]+)?\\]))",3065"captures": {3066"1": {3067"patterns": [3068{3069"include": "#type-declarations"3070},3071{3072"match": "\\w+",3073"name": "entity.name.type.go"3074}3075]3076},3077"2": {3078"patterns": [3079{3080"include": "#parameter-variable-types"3081}3082]3083}3084}3085},3086"slice_index_variables": {3087"comment": "slice index and capacity variables, to not scope them as property variables",3088"match": "(?<=\\w\\[)((?:(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+\\:)|(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+))(?:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?(?:\\:\\b[\\w\\.\\*\\+/\\-\\%\\<\\>\\|\\&]+)?)(?=\\])",3089"captures": {3090"1": {3091"patterns": [3092{3093"include": "#type-declarations"3094},3095{3096"match": "\\w+",3097"name": "variable.other.go"3098}3099]3100}3101}3102},3103"property_variables": {3104"comment": "Property variables in struct",3105"match": "((?:\\b[\\w\\.]+)(?:\\:(?!\\=)))",3106"captures": {3107"1": {3108"patterns": [3109{3110"include": "#type-declarations"3111},3112{3113"match": "\\w+",3114"name": "variable.other.property.go"3115}3116]3117}3118}3119},3120"label_loop_variables": {3121"comment": "labeled loop variable name",3122"match": "((?:^\\s*\\w+:\\s*$)|(?:^\\s*(?:\\bbreak\\b|\\bgoto\\b|\\bcontinue\\b)\\s+\\w+(?:\\s*/(?:/|\\*)\\s*.*)?$))",3123"captures": {3124"1": {3125"patterns": [3126{3127"include": "#type-declarations"3128},3129{3130"match": "\\w+",3131"name": "variable.other.label.go"3132}3133]3134}3135}3136},3137"double_parentheses_types": {3138"comment": "double parentheses types",3139"match": "(?:(?<!\\w)(\\((?:[\\[\\]\\*]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?\\))(?=\\())",3140"captures": {3141"1": {3142"patterns": [3143{3144"include": "#type-declarations-without-brackets"3145},3146{3147"match": "\\(",3148"name": "punctuation.definition.begin.bracket.round.go"3149},3150{3151"match": "\\)",3152"name": "punctuation.definition.end.bracket.round.go"3153},3154{3155"match": "\\[",3156"name": "punctuation.definition.begin.bracket.square.go"3157},3158{3159"match": "\\]",3160"name": "punctuation.definition.end.bracket.square.go"3161},3162{3163"match": "\\{",3164"name": "punctuation.definition.begin.bracket.curly.go"3165},3166{3167"match": "\\}",3168"name": "punctuation.definition.end.bracket.curly.go"3169},3170{3171"match": "\\w+",3172"name": "entity.name.type.go"3173}3174]3175}3176}3177},3178"hover": {3179"comment": "hovering with the mouse",3180"patterns": [3181{3182"comment": "struct field property and types when hovering with the mouse",3183"match": "(?:(?<=^\\bfield\\b)\\s+([\\w\\*\\.]+)\\s+([\\s\\S]+))",3184"captures": {3185"1": {3186"patterns": [3187{3188"include": "#type-declarations"3189},3190{3191"match": "\\w+",3192"name": "variable.other.property.go"3193}3194]3195},3196"2": {3197"patterns": [3198{3199"match": "\\binvalid\\b\\s+\\btype\\b",3200"name": "invalid.field.go"3201},3202{3203"include": "#type-declarations-without-brackets"3204},3205{3206"include": "#parameter-variable-types"3207},3208{3209"match": "\\w+",3210"name": "entity.name.type.go"3211}3212]3213}3214}3215},3216{3217"comment": "return types when hovering with the mouse",3218"match": "(?:(?<=^\\breturns\\b)\\s+([\\s\\S]+))",3219"captures": {3220"1": {3221"patterns": [3222{3223"include": "#type-declarations-without-brackets"3224},3225{3226"include": "#parameter-variable-types"3227},3228{3229"match": "\\w+",3230"name": "entity.name.type.go"3231}3232]3233}3234}3235}3236]3237},3238"other_variables": {3239"comment": "all other variables",3240"match": "\\w+",3241"name": "variable.other.go"3242}3243}3244}32453246