tm-grammars 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -79,7 +79,7 @@ import { grammars } from 'tm-grammars'
79
79
  | `glimmer-ts` | `gts` | [lifeart/vsc-ember-syntax](https://github.com/lifeart/vsc-ember-syntax/blob/312fb20cc04374eb8768369ebccabd12143edbe4/syntaxes/source.gts.json) | [MIT](https://raw.githubusercontent.com/lifeart/vsc-ember-syntax/master/LICENSE) | `typescript` `css` `javascript` `html` | 19.08 kB |
80
80
  | `glsl` | | [polym0rph/GLSL.tmbundle](https://github.com/polym0rph/GLSL.tmbundle/blob/6998d3bbd204e26746a5ca580cda4c650b9057b1/Syntaxes/GLSL.tmLanguage) | | `c` | 3.69 kB |
81
81
  | `gnuplot` | | [MarioSchwalbe/vscode-gnuplot](https://github.com/MarioSchwalbe/vscode-gnuplot/blob/c62c1a61c9b6b4658b43d76c397dc2ad43523b6a/syntaxes/gnuplot.tmLanguage) | [GPL-3.0](https://raw.githubusercontent.com/MarioSchwalbe/vscode-gnuplot/master/LICENSE) | | 16.46 kB |
82
- | `go` | | [microsoft/vscode](https://github.com/microsoft/vscode/blob/35d97bc7e439fce0f50f42074041ab2d8571b20a/extensions/go/syntaxes/go.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | | 41.19 kB |
82
+ | `go` | | [microsoft/vscode](https://github.com/microsoft/vscode/blob/fc771c597f7e15500921e7965f999338f2dccbd1/extensions/go/syntaxes/go.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | | 42.51 kB |
83
83
  | `graphql` | `gql` | [prisma-labs/vscode-graphql](https://github.com/prisma-labs/vscode-graphql/blob/4569aef2364b42b6acd8188e4a6ca9b0ba3c6a1d/grammars/graphql.json) | [MIT](https://raw.githubusercontent.com/graphql/vscode-graphql/master/LICENSE) | `javascript` `typescript` `jsx` `tsx` | 17.11 kB |
84
84
  | `groovy` | | [microsoft/vscode](https://github.com/microsoft/vscode/blob/8fdf170a0850c1cc027382f31650aaf300d3ae2a/extensions/groovy/syntaxes/groovy.tmLanguage.json) | [MIT](https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt) | | 18.63 kB |
85
85
  | `hack` | | [slackhq/vscode-hack](https://github.com/slackhq/vscode-hack/blob/b997653188b127a7261b0d26e7808217f3eb47bb/syntaxes/hack.json) | [MIT](https://raw.githubusercontent.com/slackhq/vscode-hack/master/LICENSE.md) | `html` `sql` | 80.66 kB |
package/grammars/go.json CHANGED
@@ -8,33 +8,29 @@
8
8
  ],
9
9
  "repository": {
10
10
  "after_control_variables": {
11
- "patterns": [
12
- {
13
- "captures": {
14
- "1": {
15
- "patterns": [
16
- {
17
- "include": "#type-declarations-without-brackets"
18
- },
19
- {
20
- "match": "\\[",
21
- "name": "punctuation.definition.begin.bracket.square.go"
22
- },
23
- {
24
- "match": "\\]",
25
- "name": "punctuation.definition.end.bracket.square.go"
26
- },
27
- {
28
- "match": "(?:\\w+)",
29
- "name": "variable.other.go"
30
- }
31
- ]
11
+ "captures": {
12
+ "1": {
13
+ "patterns": [
14
+ {
15
+ "include": "#type-declarations-without-brackets"
16
+ },
17
+ {
18
+ "match": "\\[",
19
+ "name": "punctuation.definition.begin.bracket.square.go"
20
+ },
21
+ {
22
+ "match": "\\]",
23
+ "name": "punctuation.definition.end.bracket.square.go"
24
+ },
25
+ {
26
+ "match": "(?:\\w+)",
27
+ "name": "variable.other.go"
32
28
  }
33
- },
34
- "comment": "After control variables, to not highlight as a struct/interface",
35
- "match": "(?:(?<=\\brange\\b|\\bswitch\\b|\\;|\\bif\\b|\\bfor\\b|\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)|\\w(?:\\+|/|\\-|\\*|\\%)\\=|\\|\\||\\&\\&)(?:\\s*)([[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))"
29
+ ]
36
30
  }
37
- ]
31
+ },
32
+ "comment": "After control variables, to not highlight as a struct/interface (before formatting with gofmt)",
33
+ "match": "(?:(?<=\\brange\\b|\\bswitch\\b|\\;|\\bif\\b|\\bfor\\b|\\<|\\>|\\<\\=|\\>\\=|\\=\\=|\\!\\=|\\w(?:\\+|/|\\-|\\*|\\%)|\\w(?:\\+|/|\\-|\\*|\\%)\\=|\\|\\||\\&\\&)(?:\\s*)([[:alnum:]\\-\\_\\!\\.\\[\\]\\<\\>\\=\\*/\\+\\%\\:]+)(?:\\s*)(?=\\{))"
38
34
  },
39
35
  "brackets": {
40
36
  "patterns": [
@@ -177,7 +173,7 @@
177
173
  }
178
174
  },
179
175
  "comment": "make keyword",
180
- "match": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]\\{\\}]+)(?:\\[(?:[^\\]]+)?\\])?(?:[\\w\\.\\*\\[\\]\\{\\}]+)?)?((?:\\,\\s*[\\w\\.\\(\\)]+)+)?(\\))))"
176
+ "match": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?:[\\w\\.\\*\\[\\]\\{\\}]+)?(?:\\[(?:[^\\]]+)?\\])?(?:[\\w\\.\\*\\[\\]\\{\\}]+)?)?((?:\\,\\s*(?:[\\w\\.\\(\\)]+)?)+)?(\\))))"
181
177
  }
182
178
  ]
183
179
  },
@@ -614,7 +610,7 @@
614
610
  }
615
611
  },
616
612
  "comment": "functions in-line with multi return types",
617
- "match": "(?:(\\bfunc\\b)((?:\\((?:.*)\\))(?:\\s+)(?:\\((?:.*)\\)))(?:\\s+)(?=\\{))"
613
+ "match": "(?:(\\bfunc\\b)((?:\\((?:[^/]*)\\))(?:\\s+)(?:\\((?:[^/]*)\\)))(?:\\s+)(?=\\{))"
618
614
  },
619
615
  "generic_param_types": {
620
616
  "comment": "generic parameter variables and types",
@@ -1028,148 +1024,112 @@
1028
1024
  "match": "\\b(true|false|nil|iota)\\b",
1029
1025
  "name": "constant.language.go"
1030
1026
  },
1031
- "map_other_types": {
1032
- "patterns": [
1033
- {
1034
- "captures": {
1035
- "1": {
1036
- "name": "keyword.map.go"
1037
- },
1038
- "2": {
1039
- "patterns": [
1040
- {
1041
- "include": "#type-declarations-without-brackets"
1042
- },
1043
- {
1044
- "match": "\\[",
1045
- "name": "punctuation.definition.begin.bracket.square.go"
1046
- },
1047
- {
1048
- "match": "\\]",
1049
- "name": "punctuation.definition.end.bracket.square.go"
1050
- },
1051
- {
1052
- "match": "\\{",
1053
- "name": "punctuation.definition.begin.bracket.curly.go"
1054
- },
1055
- {
1056
- "match": "\\}",
1057
- "name": "punctuation.definition.end.bracket.curly.go"
1058
- },
1059
- {
1060
- "match": "\\(",
1061
- "name": "punctuation.definition.begin.bracket.round.go"
1062
- },
1063
- {
1064
- "match": "\\)",
1065
- "name": "punctuation.definition.end.bracket.round.go"
1066
- },
1067
- {
1068
- "match": "\\w+",
1069
- "name": "entity.name.type.go"
1070
- }
1071
- ]
1072
- },
1073
- "3": {
1074
- "patterns": [
1075
- {
1076
- "include": "#type-declarations"
1077
- },
1078
- {
1079
- "match": "\\w+",
1080
- "name": "entity.name.type.go"
1081
- }
1082
- ]
1083
- }
1084
- },
1085
- "comment": "Other map type names (struct/interface)",
1086
- "match": "(?:(\\bmap\\b)(\\[(?:.*)\\])?((?!\\bfunc\\b|\\bstruct\\b)[\\w\\.\\*]+)?)"
1027
+ "map_types": {
1028
+ "begin": "(?:(\\bmap\\b)(\\[))",
1029
+ "beginCaptures": {
1030
+ "1": {
1031
+ "name": "keyword.map.go"
1032
+ },
1033
+ "2": {
1034
+ "name": "punctuation.definition.begin.bracket.square.go"
1087
1035
  }
1088
- ]
1089
- },
1090
- "multi_types": {
1091
- "patterns": [
1092
- {
1093
- "begin": "(\\btype\\b)\\s*(\\()",
1094
- "beginCaptures": {
1095
- "1": {
1096
- "name": "keyword.type.go"
1097
- },
1098
- "2": {
1099
- "name": "punctuation.definition.begin.bracket.round.go"
1100
- }
1101
- },
1102
- "comment": "multi type declaration",
1103
- "end": "\\)",
1104
- "endCaptures": {
1105
- "0": {
1106
- "name": "punctuation.definition.end.bracket.round.go"
1107
- }
1108
- },
1036
+ },
1037
+ "comment": "map types",
1038
+ "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)[\\w\\.\\[\\]\\*]+)?)",
1039
+ "endCaptures": {
1040
+ "1": {
1041
+ "name": "punctuation.definition.end.bracket.square.go"
1042
+ },
1043
+ "2": {
1109
1044
  "patterns": [
1110
1045
  {
1111
- "include": "#struct_variables_types"
1046
+ "include": "#type-declarations-without-brackets"
1112
1047
  },
1113
1048
  {
1114
- "include": "#type-declarations-without-brackets"
1049
+ "match": "\\[",
1050
+ "name": "punctuation.definition.begin.bracket.square.go"
1115
1051
  },
1116
1052
  {
1117
- "include": "#parameter-variable-types"
1053
+ "match": "\\]",
1054
+ "name": "punctuation.definition.end.bracket.square.go"
1118
1055
  },
1119
1056
  {
1120
- "match": "(?:\\w+)",
1057
+ "match": "\\w+",
1121
1058
  "name": "entity.name.type.go"
1122
1059
  }
1123
1060
  ]
1061
+ }
1062
+ },
1063
+ "patterns": [
1064
+ {
1065
+ "include": "#type-declarations-without-brackets"
1124
1066
  },
1125
1067
  {
1126
- "begin": "(?:(?:^|\\s+)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?=\\[))",
1127
- "beginCaptures": {
1128
- "1": {
1129
- "name": "keyword.type.go"
1130
- },
1131
- "2": {
1132
- "patterns": [
1133
- {
1134
- "include": "#type-declarations-without-brackets"
1135
- },
1136
- {
1137
- "match": "(?:\\w+)",
1138
- "name": "entity.name.type.go"
1139
- }
1140
- ]
1141
- }
1142
- },
1143
- "comment": "single type declaration with multi-lines generics",
1144
- "end": "(?:(?<=\\])((?:\\s+)(?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b|\\bfunc\\b))[\\w\\.\\-\\*\\[\\]]+))?)",
1145
- "endCaptures": {
1146
- "1": {
1147
- "patterns": [
1148
- {
1149
- "include": "#type-declarations-without-brackets"
1150
- },
1151
- {
1152
- "match": "(?:\\w+)",
1153
- "name": "entity.name.type.go"
1154
- }
1155
- ]
1156
- }
1157
- },
1158
- "patterns": [
1159
- {
1160
- "include": "#struct_variables_types"
1161
- },
1162
- {
1163
- "include": "#type-declarations-without-brackets"
1164
- },
1165
- {
1166
- "include": "#parameter-variable-types"
1167
- },
1168
- {
1169
- "match": "(?:\\w+)",
1170
- "name": "entity.name.type.go"
1171
- }
1172
- ]
1068
+ "include": "#generic_types"
1069
+ },
1070
+ {
1071
+ "include": "#functions"
1072
+ },
1073
+ {
1074
+ "match": "\\[",
1075
+ "name": "punctuation.definition.begin.bracket.square.go"
1076
+ },
1077
+ {
1078
+ "match": "\\]",
1079
+ "name": "punctuation.definition.end.bracket.square.go"
1080
+ },
1081
+ {
1082
+ "match": "\\{",
1083
+ "name": "punctuation.definition.begin.bracket.curly.go"
1084
+ },
1085
+ {
1086
+ "match": "\\}",
1087
+ "name": "punctuation.definition.end.bracket.curly.go"
1088
+ },
1089
+ {
1090
+ "match": "\\(",
1091
+ "name": "punctuation.definition.begin.bracket.round.go"
1092
+ },
1093
+ {
1094
+ "match": "\\)",
1095
+ "name": "punctuation.definition.end.bracket.round.go"
1096
+ },
1097
+ {
1098
+ "match": "\\w+",
1099
+ "name": "entity.name.type.go"
1100
+ }
1101
+ ]
1102
+ },
1103
+ "multi_types": {
1104
+ "begin": "(\\btype\\b)\\s*(\\()",
1105
+ "beginCaptures": {
1106
+ "1": {
1107
+ "name": "keyword.type.go"
1108
+ },
1109
+ "2": {
1110
+ "name": "punctuation.definition.begin.bracket.round.go"
1111
+ }
1112
+ },
1113
+ "comment": "multi type declaration",
1114
+ "end": "\\)",
1115
+ "endCaptures": {
1116
+ "0": {
1117
+ "name": "punctuation.definition.end.bracket.round.go"
1118
+ }
1119
+ },
1120
+ "patterns": [
1121
+ {
1122
+ "include": "#struct_variables_types"
1123
+ },
1124
+ {
1125
+ "include": "#type-declarations-without-brackets"
1126
+ },
1127
+ {
1128
+ "include": "#parameter-variable-types"
1129
+ },
1130
+ {
1131
+ "match": "(?:\\w+)",
1132
+ "name": "entity.name.type.go"
1173
1133
  }
1174
1134
  ]
1175
1135
  },
@@ -1563,6 +1523,7 @@
1563
1523
  "comment": "struct and interface expression in-line (before curly bracket)",
1564
1524
  "patterns": [
1565
1525
  {
1526
+ "comment": "after control variables must be added exactly here, do not move it! (changing may not affect tests, so be careful!)",
1566
1527
  "include": "#after_control_variables"
1567
1528
  },
1568
1529
  {
@@ -1853,38 +1814,12 @@
1853
1814
  "include": "#type-declarations"
1854
1815
  },
1855
1816
  {
1856
- "match": "(?:\\w+)",
1817
+ "match": "\\w+",
1857
1818
  "name": "entity.name.type.go"
1858
1819
  }
1859
1820
  ]
1860
1821
  },
1861
1822
  "3": {
1862
- "patterns": [
1863
- {
1864
- "begin": "\\[",
1865
- "beginCaptures": {
1866
- "0": {
1867
- "name": "punctuation.definition.begin.bracket.square.go"
1868
- }
1869
- },
1870
- "end": "\\]",
1871
- "endCaptures": {
1872
- "0": {
1873
- "name": "punctuation.definition.end.bracket.square.go"
1874
- }
1875
- },
1876
- "patterns": [
1877
- {
1878
- "include": "#generic_param_types"
1879
- },
1880
- {
1881
- "include": "$self"
1882
- }
1883
- ]
1884
- }
1885
- ]
1886
- },
1887
- "4": {
1888
1823
  "patterns": [
1889
1824
  {
1890
1825
  "begin": "\\(",
@@ -1915,14 +1850,95 @@
1915
1850
  "include": "#generic_types"
1916
1851
  },
1917
1852
  {
1918
- "match": "(?:\\w+)",
1853
+ "match": "\\w+",
1919
1854
  "name": "entity.name.type.go"
1920
1855
  }
1921
1856
  ]
1922
1857
  }
1923
1858
  },
1924
1859
  "comment": "single type declaration",
1925
- "match": "(?:(?:^|\\s+)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(\\[(?:.*)\\])?(?:\\s+)((?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b))([\\s\\S]+)))"
1860
+ "match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?:\\s+)(?!(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b)([\\s\\S]+))"
1861
+ },
1862
+ {
1863
+ "begin": "(?:(?:^|\\s+)(\\btype\\b)(?:\\s*)([\\w\\.\\*]+)(?=\\[))",
1864
+ "beginCaptures": {
1865
+ "1": {
1866
+ "name": "keyword.type.go"
1867
+ },
1868
+ "2": {
1869
+ "patterns": [
1870
+ {
1871
+ "include": "#type-declarations-without-brackets"
1872
+ },
1873
+ {
1874
+ "match": "\\w+",
1875
+ "name": "entity.name.type.go"
1876
+ }
1877
+ ]
1878
+ }
1879
+ },
1880
+ "comment": "single type declaration with generics",
1881
+ "end": "(?:(?<=\\])((?:\\s+)(?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?:(?!(?:[\\[\\]\\*]+)?(?:\\bstruct\\b|\\binterface\\b|\\bfunc\\b))[\\w\\.\\-\\*\\[\\]]+))?)",
1882
+ "endCaptures": {
1883
+ "1": {
1884
+ "patterns": [
1885
+ {
1886
+ "include": "#type-declarations-without-brackets"
1887
+ },
1888
+ {
1889
+ "match": "\\[",
1890
+ "name": "punctuation.definition.begin.bracket.square.go"
1891
+ },
1892
+ {
1893
+ "match": "\\]",
1894
+ "name": "punctuation.definition.end.bracket.square.go"
1895
+ },
1896
+ {
1897
+ "match": "\\w+",
1898
+ "name": "entity.name.type.go"
1899
+ }
1900
+ ]
1901
+ }
1902
+ },
1903
+ "patterns": [
1904
+ {
1905
+ "include": "#struct_variables_types"
1906
+ },
1907
+ {
1908
+ "include": "#type-declarations-without-brackets"
1909
+ },
1910
+ {
1911
+ "include": "#parameter-variable-types"
1912
+ },
1913
+ {
1914
+ "match": "\\[",
1915
+ "name": "punctuation.definition.begin.bracket.square.go"
1916
+ },
1917
+ {
1918
+ "match": "\\]",
1919
+ "name": "punctuation.definition.end.bracket.square.go"
1920
+ },
1921
+ {
1922
+ "match": "\\{",
1923
+ "name": "punctuation.definition.begin.bracket.curly.go"
1924
+ },
1925
+ {
1926
+ "match": "\\}",
1927
+ "name": "punctuation.definition.end.bracket.curly.go"
1928
+ },
1929
+ {
1930
+ "match": "\\(",
1931
+ "name": "punctuation.definition.begin.bracket.round.go"
1932
+ },
1933
+ {
1934
+ "match": "\\)",
1935
+ "name": "punctuation.definition.end.bracket.round.go"
1936
+ },
1937
+ {
1938
+ "match": "\\w+",
1939
+ "name": "entity.name.type.go"
1940
+ }
1941
+ ]
1926
1942
  }
1927
1943
  ]
1928
1944
  },
@@ -2056,41 +2072,18 @@
2056
2072
  },
2057
2073
  "2": {
2058
2074
  "patterns": [
2075
+ {
2076
+ "include": "#type-declarations"
2077
+ },
2059
2078
  {
2060
2079
  "match": "\\w+",
2061
2080
  "name": "entity.name.type.go"
2062
2081
  }
2063
2082
  ]
2064
- },
2065
- "3": {
2066
- "patterns": [
2067
- {
2068
- "begin": "\\[",
2069
- "beginCaptures": {
2070
- "0": {
2071
- "name": "punctuation.definition.begin.bracket.square.go"
2072
- }
2073
- },
2074
- "end": "\\]",
2075
- "endCaptures": {
2076
- "0": {
2077
- "name": "punctuation.definition.end.bracket.square.go"
2078
- }
2079
- },
2080
- "patterns": [
2081
- {
2082
- "include": "#generic_param_types"
2083
- },
2084
- {
2085
- "include": "$self"
2086
- }
2087
- ]
2088
- }
2089
- ]
2090
2083
  }
2091
2084
  },
2092
- "comment": "struct, interface type declarations",
2093
- "match": "(?:(?:^|\\s+)(\\btype\\b)(?:\\s+)([\\w\\.]+)(\\[(?:.*)\\])?)"
2085
+ "comment": "struct, interface type declarations (related to: struct_variables_types, interface_variables_types)",
2086
+ "match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.]+))"
2094
2087
  },
2095
2088
  "struct_variable_types_fields_multi": {
2096
2089
  "patterns": [
@@ -2328,14 +2321,22 @@
2328
2321
  "name": "punctuation.definition.end.bracket.square.go"
2329
2322
  },
2330
2323
  {
2331
- "match": "(?:\\w+)",
2324
+ "match": "\\{",
2325
+ "name": "punctuation.definition.begin.bracket.curly.go"
2326
+ },
2327
+ {
2328
+ "match": "\\}",
2329
+ "name": "punctuation.definition.end.bracket.curly.go"
2330
+ },
2331
+ {
2332
+ "match": "\\w+",
2332
2333
  "name": "entity.name.type.go"
2333
2334
  }
2334
2335
  ]
2335
2336
  }
2336
2337
  },
2337
2338
  "comment": "Support Functions",
2338
- "match": "(?:(?:((?<=\\.)\\w+)|(\\w+))(\\[(?:.*)?\\])?(?=\\())"
2339
+ "match": "(?:(?:((?<=\\.)\\w+)|(\\w+))(\\[(?:(?:[\\w\\.\\*\\[\\]\\{\\}\"\\']+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]\\{\\}]+))*))?\\])?(?=\\())"
2339
2340
  },
2340
2341
  "switch_select_case_variables": {
2341
2342
  "captures": {
@@ -2483,7 +2484,7 @@
2483
2484
  "include": "#comments"
2484
2485
  },
2485
2486
  {
2486
- "include": "#map_other_types"
2487
+ "include": "#map_types"
2487
2488
  },
2488
2489
  {
2489
2490
  "include": "#brackets"
@@ -2527,7 +2528,7 @@
2527
2528
  "include": "#comments"
2528
2529
  },
2529
2530
  {
2530
- "include": "#map_other_types"
2531
+ "include": "#map_types"
2531
2532
  },
2532
2533
  {
2533
2534
  "include": "#delimiters"
@@ -2589,7 +2590,7 @@
2589
2590
  "include": "#delimiters"
2590
2591
  },
2591
2592
  {
2592
- "match": "(?:\\w+)",
2593
+ "match": "\\w+",
2593
2594
  "name": "variable.other.assignment.go"
2594
2595
  }
2595
2596
  ]
@@ -2597,20 +2598,36 @@
2597
2598
  "2": {
2598
2599
  "patterns": [
2599
2600
  {
2600
- "include": "#type-declarations"
2601
+ "include": "#type-declarations-without-brackets"
2601
2602
  },
2602
2603
  {
2603
2604
  "include": "#generic_types"
2604
2605
  },
2605
2606
  {
2606
- "match": "(?:\\w+)",
2607
+ "match": "\\(",
2608
+ "name": "punctuation.definition.begin.bracket.round.go"
2609
+ },
2610
+ {
2611
+ "match": "\\)",
2612
+ "name": "punctuation.definition.end.bracket.round.go"
2613
+ },
2614
+ {
2615
+ "match": "\\[",
2616
+ "name": "punctuation.definition.begin.bracket.square.go"
2617
+ },
2618
+ {
2619
+ "match": "\\]",
2620
+ "name": "punctuation.definition.end.bracket.square.go"
2621
+ },
2622
+ {
2623
+ "match": "\\w+",
2607
2624
  "name": "entity.name.type.go"
2608
2625
  }
2609
2626
  ]
2610
2627
  }
2611
2628
  },
2612
2629
  "comment": "var and const with single type assignment",
2613
- "match": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)([\\w\\.]+(?:(?:\\,\\s*[\\w\\.]+)+)?)(?:\\s*)(?:((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)|(?:(?:[\\[\\]\\*]+)?\\bfunc\\b))(?:(?:(?:[\\w\\.\\*]+)?(?:\\[(?:.*)\\])?(?:[\\w\\.\\*]+)?))?\\s*(?:\\=)?))?)"
2630
+ "match": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)"
2614
2631
  },
2615
2632
  {
2616
2633
  "begin": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\())",
@@ -2635,7 +2652,7 @@
2635
2652
  "include": "#delimiters"
2636
2653
  },
2637
2654
  {
2638
- "match": "(?:\\w+)",
2655
+ "match": "\\w+",
2639
2656
  "name": "variable.other.assignment.go"
2640
2657
  }
2641
2658
  ]
@@ -2643,19 +2660,35 @@
2643
2660
  "2": {
2644
2661
  "patterns": [
2645
2662
  {
2646
- "include": "#type-declarations"
2663
+ "include": "#type-declarations-without-brackets"
2647
2664
  },
2648
2665
  {
2649
2666
  "include": "#generic_types"
2650
2667
  },
2651
2668
  {
2652
- "match": "(?:\\w+)",
2669
+ "match": "\\(",
2670
+ "name": "punctuation.definition.begin.bracket.round.go"
2671
+ },
2672
+ {
2673
+ "match": "\\)",
2674
+ "name": "punctuation.definition.end.bracket.round.go"
2675
+ },
2676
+ {
2677
+ "match": "\\[",
2678
+ "name": "punctuation.definition.begin.bracket.square.go"
2679
+ },
2680
+ {
2681
+ "match": "\\]",
2682
+ "name": "punctuation.definition.end.bracket.square.go"
2683
+ },
2684
+ {
2685
+ "match": "\\w+",
2653
2686
  "name": "entity.name.type.go"
2654
2687
  }
2655
2688
  ]
2656
2689
  }
2657
2690
  },
2658
- "match": "(?:(?:^\\s+)([\\w\\.]+(?:(?:\\,\\s*[\\w\\.]+)+)?)(?:\\s*)((?:((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+)?(?!(?:(?:[\\[\\]\\*]+)?\\bstruct\\b\\s*\\{)|(?:(?:[\\[\\]\\*]+)?\\bfunc\\b))(?:(?:(?:[\\w\\.\\*]+)?(?:\\[(?:.*)\\])?(?:[\\w\\.\\*]+)?))?\\s*(?:\\=)?))?))"
2691
+ "match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:\\<\\-\\s*)?\\bchan\\b(?:\\s*\\<\\-)?\\s*)+(?:\\([^\\)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:\\=)?)?)"
2659
2692
  },
2660
2693
  {
2661
2694
  "include": "$self"
package/index.js CHANGED
@@ -870,18 +870,18 @@ export const grammars = [
870
870
  source: 'https://github.com/MarioSchwalbe/vscode-gnuplot/blob/c62c1a61c9b6b4658b43d76c397dc2ad43523b6a/syntaxes/gnuplot.tmLanguage',
871
871
  },
872
872
  {
873
- byteSize: 42183,
873
+ byteSize: 43529,
874
874
  categories: [
875
875
  'general',
876
876
  ],
877
877
  displayName: 'Go',
878
- lastUpdate: '2024-01-26T12:06:22Z',
878
+ lastUpdate: '2024-02-07T13:33:31Z',
879
879
  license: 'MIT',
880
880
  licenseUrl: 'https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt',
881
881
  name: 'go',
882
882
  scopeName: 'source.go',
883
- sha: '35d97bc7e439fce0f50f42074041ab2d8571b20a',
884
- source: 'https://github.com/microsoft/vscode/blob/35d97bc7e439fce0f50f42074041ab2d8571b20a/extensions/go/syntaxes/go.tmLanguage.json',
883
+ sha: 'fc771c597f7e15500921e7965f999338f2dccbd1',
884
+ source: 'https://github.com/microsoft/vscode/blob/fc771c597f7e15500921e7965f999338f2dccbd1/extensions/go/syntaxes/go.tmLanguage.json',
885
885
  },
886
886
  {
887
887
  aliases: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tm-grammars",
3
3
  "type": "module",
4
- "version": "1.1.3",
4
+ "version": "1.1.4",
5
5
  "packageManager": "pnpm@8.15.1",
6
6
  "description": "Collecton of TextMate grammars in JSON",
7
7
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",