github-linguist 5.0.0 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/bin/git-linguist +10 -2
  3. data/bin/linguist +26 -9
  4. data/grammars/config.xcompose.json +83 -0
  5. data/grammars/hint.haskell.json +21 -30
  6. data/grammars/hint.message.haskell.json +21 -30
  7. data/grammars/hint.type.haskell.json +21 -30
  8. data/grammars/source.bsl.json +42 -28
  9. data/grammars/source.cs.json +656 -131
  10. data/grammars/source.csound-document.json +142 -25
  11. data/grammars/source.csound-score.json +13 -10
  12. data/grammars/source.csound.json +136 -81
  13. data/grammars/source.css.json +1501 -331
  14. data/grammars/source.css.less.json +3 -3
  15. data/grammars/source.d.json +60 -44
  16. data/grammars/source.gn.json +240 -138
  17. data/grammars/source.graphql.json +781 -155
  18. data/grammars/source.haskell.json +21 -30
  19. data/grammars/source.js.json +46 -46
  20. data/grammars/source.mask.json +1 -1
  21. data/grammars/source.perl6fe.json +1151 -763
  22. data/grammars/source.python.json +45 -23
  23. data/grammars/source.quoting.perl6fe.json +2170 -0
  24. data/grammars/source.reason.json +296 -0
  25. data/grammars/source.regexp.perl6fe.json +27 -0
  26. data/grammars/source.rust.json +522 -125
  27. data/grammars/source.sdbl.json +2 -2
  28. data/grammars/source.shell.json +125 -161
  29. data/grammars/source.solidity.json +137 -0
  30. data/grammars/source.ts.json +385 -137
  31. data/grammars/source.tsx.json +394 -167
  32. data/grammars/source.yaml.json +176 -171
  33. data/grammars/text.html.php.blade.json +2 -2
  34. data/grammars/text.tex.latex.haskell.json +1 -10
  35. data/lib/linguist/generated.rb +50 -4
  36. data/lib/linguist/heuristics.rb +1 -1
  37. data/lib/linguist/language.rb +12 -8
  38. data/lib/linguist/languages.json +1 -1
  39. data/lib/linguist/languages.yml +38 -1
  40. data/lib/linguist/samples.json +4605 -581
  41. data/lib/linguist/vendor.yml +6 -0
  42. data/lib/linguist/version.rb +1 -1
  43. metadata +10 -7
  44. data/grammars/source.hy.json +0 -270
@@ -0,0 +1,137 @@
1
+ {
2
+ "fileTypes": [
3
+ "sol"
4
+ ],
5
+ "name": "Solidity",
6
+ "patterns": [
7
+ {
8
+ "comment": "Comments",
9
+ "match": "\\/\\/.*",
10
+ "name": "comment"
11
+ },
12
+ {
13
+ "begin": "(\\/\\*)",
14
+ "comment": "Multiline comments",
15
+ "end": "(\\*\\/)",
16
+ "name": "comment"
17
+ },
18
+ {
19
+ "captures": {
20
+ "2": {
21
+ "name": "support.function"
22
+ }
23
+ },
24
+ "comment": "Events",
25
+ "match": "\\b(event|enum)\\s+([A-Za-z_]\\w*)\\b",
26
+ "name": "keyword.control"
27
+ },
28
+ {
29
+ "captures": {
30
+ "2": {
31
+ "name": "entity.name.function"
32
+ },
33
+ "3": {
34
+ "name": "entity.name.function"
35
+ }
36
+ },
37
+ "comment": "Main keywords",
38
+ "match": "\\b(contract|library|using|struct|function|modifier)\\s+([A-Za-z_]\\w*)(?:\\s+is\\s+((?:[A-Za-z_][\\,\\s]*)*))?\\b",
39
+ "name": "keyword.control"
40
+ },
41
+ {
42
+ "captures": {
43
+ "1": {
44
+ "name": "constant.language"
45
+ },
46
+ "2": {
47
+ "name": "variable.parameter"
48
+ }
49
+ },
50
+ "comment": "Built-in types",
51
+ "match": "\\b(address|string|bytes\\d*|int\\d*|uint\\d*|bool|u?fixed\\d+x\\d+)\\b(?:\\s+(?:indexed\\s+)?([A-Za-z_]\\w*)\\s*[,\\)])?"
52
+ },
53
+ {
54
+ "captures": {
55
+ "1": {
56
+ "name": "constant.language"
57
+ },
58
+ "2": {
59
+ "name": "constant.language"
60
+ },
61
+ "3": {
62
+ "name": "constant.language"
63
+ },
64
+ "4": {
65
+ "name": "keyword.control"
66
+ }
67
+ },
68
+ "comment": "Mapping definition",
69
+ "match": "\\b(mapping)\\s*\\((.*)\\s+=>\\s+(.*)\\)(\\s+(?:private|public|internal|external|inherited))?\\s+([A-Za-z_]\\w*)\\b"
70
+ },
71
+ {
72
+ "comment": "True and false keywords",
73
+ "match": "\\b(true|false)\\b",
74
+ "name": "constant.language"
75
+ },
76
+ {
77
+ "comment": "Langauge keywords",
78
+ "match": "\\b(var|import|function|constant|if|else|for|while|do|break|continue|returns?|private|public|internal|external|inherited|this|suicide|new|is|throw|\\_)\\b",
79
+ "name": "keyword.control"
80
+ },
81
+ {
82
+ "captures": {
83
+ "1": {
84
+ "name": "constant.language"
85
+ },
86
+ "2": {
87
+ "name": "keyword.control"
88
+ }
89
+ },
90
+ "comment": "Variable definitions",
91
+ "match": "\\b([A-Za-z_]\\w+)(\\s+(?:private|public|internal|external|inherited))?\\s+([A-Za-z_]\\w*)\\;"
92
+ },
93
+ {
94
+ "comment": "Operators",
95
+ "match": "(=|!|>|<|\\||&|\\?|:|\\^|~|\\*|\\+|-|\\/|\\%)",
96
+ "name": "keyword.control"
97
+ },
98
+ {
99
+ "captures": {
100
+ "1": {
101
+ "name": "constant.language"
102
+ },
103
+ "2": {
104
+ "name": "constant.language"
105
+ }
106
+ },
107
+ "comment": "msg and block special usage",
108
+ "match": "\\b(msg|block|tx)\\.([A-Za-z_]\\w*)\\b"
109
+ },
110
+ {
111
+ "captures": {
112
+ "1": {
113
+ "name": "support.type"
114
+ }
115
+ },
116
+ "comment": "Function call",
117
+ "match": "\\b([A-Za-z_]\\w*)\\s*\\("
118
+ },
119
+ {
120
+ "comment": "Strings",
121
+ "match": "([\\\"\\'].*?[\\\"\\'])",
122
+ "name": "string.quoted"
123
+ },
124
+ {
125
+ "comment": "Numbers",
126
+ "match": "\\b(\\d+)\\b",
127
+ "name": "constant.numeric"
128
+ },
129
+ {
130
+ "comment": "Hexadecimal",
131
+ "match": "\\b(0[xX][a-fA-F0-9]+)\\b",
132
+ "name": "constant.numeric"
133
+ }
134
+ ],
135
+ "scopeName": "source.solidity",
136
+ "uuid": "ad87d2cd-8575-4afe-984e-9421a3788933"
137
+ }
@@ -6,8 +6,20 @@
6
6
  ],
7
7
  "uuid": "ef98eb90-bf9b-11e4-bb52-0800200c9a66",
8
8
  "patterns": [
9
+ {
10
+ "include": "#directives"
11
+ },
9
12
  {
10
13
  "include": "#statements"
14
+ },
15
+ {
16
+ "name": "comment.line.shebang.ts",
17
+ "match": "\\A(#!).*(?=$)",
18
+ "captures": {
19
+ "1": {
20
+ "name": "punctuation.definition.comment.ts"
21
+ }
22
+ }
11
23
  }
12
24
  ],
13
25
  "repository": {
@@ -16,9 +28,6 @@
16
28
  {
17
29
  "include": "#string"
18
30
  },
19
- {
20
- "include": "#regex"
21
- },
22
31
  {
23
32
  "include": "#template"
24
33
  },
@@ -85,23 +94,58 @@
85
94
  ]
86
95
  },
87
96
  "var-single-variable": {
88
- "name": "meta.var-single-variable.expr.ts",
89
- "begin": "([_$[:alpha:]][_$[:alnum:]]*)",
90
- "beginCaptures": {
91
- "1": {
92
- "name": "meta.definition.variable.ts variable.other.readwrite.ts"
93
- }
94
- },
95
- "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
96
97
  "patterns": [
97
98
  {
98
- "include": "#type-annotation"
99
+ "name": "meta.var-single-variable.expr.ts",
100
+ "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\n (=\\s*(\n (async\\s+) |\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))\n ) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )))\n )\n)",
101
+ "beginCaptures": {
102
+ "1": {
103
+ "name": "meta.definition.variable.ts entity.name.function.ts"
104
+ }
105
+ },
106
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
107
+ "patterns": [
108
+ {
109
+ "include": "#type-annotation"
110
+ },
111
+ {
112
+ "include": "#string"
113
+ },
114
+ {
115
+ "include": "#comment"
116
+ }
117
+ ]
99
118
  },
100
119
  {
101
- "include": "#string"
120
+ "name": "meta.var-single-variable.expr.ts",
121
+ "begin": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])",
122
+ "beginCaptures": {
123
+ "1": {
124
+ "name": "meta.definition.variable.ts variable.other.constant.ts"
125
+ }
126
+ },
127
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))"
102
128
  },
103
129
  {
104
- "include": "#comment"
130
+ "name": "meta.var-single-variable.expr.ts",
131
+ "begin": "([_$[:alpha:]][_$[:alnum:]]*)",
132
+ "beginCaptures": {
133
+ "1": {
134
+ "name": "meta.definition.variable.ts variable.other.readwrite.ts"
135
+ }
136
+ },
137
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
138
+ "patterns": [
139
+ {
140
+ "include": "#type-annotation"
141
+ },
142
+ {
143
+ "include": "#string"
144
+ },
145
+ {
146
+ "include": "#comment"
147
+ }
148
+ ]
105
149
  }
106
150
  ]
107
151
  },
@@ -147,29 +191,14 @@
147
191
  "include": "#comment"
148
192
  },
149
193
  {
150
- "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
151
- "beginCaptures": {
152
- "1": {
153
- "name": "variable.object.property.ts"
154
- },
155
- "2": {
156
- "name": "punctuation.destructuring.ts"
157
- }
158
- },
194
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))",
159
195
  "end": "(?=,|\\})",
160
196
  "patterns": [
161
197
  {
162
- "include": "#object-binding-pattern"
163
- },
164
- {
165
- "include": "#array-binding-pattern"
166
- },
167
- {
168
- "name": "meta.definition.variable.ts variable.other.readwrite.ts",
169
- "match": "([_$[:alpha:]][_$[:alnum:]]*)"
198
+ "include": "#object-binding-element-propertyName"
170
199
  },
171
200
  {
172
- "include": "#variable-initializer"
201
+ "include": "#binding-element"
173
202
  }
174
203
  ]
175
204
  },
@@ -187,7 +216,28 @@
187
216
  }
188
217
  ]
189
218
  },
190
- "array-binding-element": {
219
+ "object-binding-element-propertyName": {
220
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))",
221
+ "end": "(:)",
222
+ "endCaptures": {
223
+ "0": {
224
+ "name": "punctuation.destructuring.ts"
225
+ }
226
+ },
227
+ "patterns": [
228
+ {
229
+ "include": "#string"
230
+ },
231
+ {
232
+ "include": "#array-literal"
233
+ },
234
+ {
235
+ "name": "variable.object.property.ts",
236
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
237
+ }
238
+ ]
239
+ },
240
+ "binding-element": {
191
241
  "patterns": [
192
242
  {
193
243
  "include": "#comment"
@@ -203,9 +253,6 @@
203
253
  },
204
254
  {
205
255
  "include": "#variable-initializer"
206
- },
207
- {
208
- "include": "#punctuation-comma"
209
256
  }
210
257
  ]
211
258
  },
@@ -260,23 +307,14 @@
260
307
  },
261
308
  "patterns": [
262
309
  {
263
- "include": "#array-binding-element"
264
- }
265
- ]
266
- },
267
- "ternary-expression": {
268
- "begin": "(?=\\?)",
269
- "end": "(?=$|[;,})\\]])",
270
- "patterns": [
271
- {
272
- "include": "#ternary-operator"
310
+ "include": "#binding-element"
273
311
  },
274
312
  {
275
- "include": "#expression"
313
+ "include": "#punctuation-comma"
276
314
  }
277
315
  ]
278
316
  },
279
- "ternary-operator": {
317
+ "ternary-expression": {
280
318
  "begin": "(\\?)",
281
319
  "beginCaptures": {
282
320
  "0": {
@@ -338,10 +376,10 @@
338
376
  "include": "#expression-operators"
339
377
  },
340
378
  {
341
- "include": "#support-objects"
379
+ "include": "#function-call"
342
380
  },
343
381
  {
344
- "include": "#function-call"
382
+ "include": "#support-objects"
345
383
  },
346
384
  {
347
385
  "include": "#identifiers"
@@ -546,12 +584,15 @@
546
584
  ]
547
585
  },
548
586
  {
549
- "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")))",
587
+ "begin": "(?=((\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\])))",
550
588
  "end": "(?=,|\\}|$)",
551
589
  "patterns": [
552
590
  {
553
591
  "include": "#string"
554
592
  },
593
+ {
594
+ "include": "#array-literal"
595
+ },
555
596
  {
556
597
  "include": "#comment"
557
598
  },
@@ -591,8 +632,7 @@
591
632
  "match": "([_$[:alpha:]][_$[:alnum:]]*)"
592
633
  },
593
634
  {
594
- "name": "punctuation.accessor.ts",
595
- "match": "\\."
635
+ "include": "#punctuation-accessor"
596
636
  }
597
637
  ]
598
638
  },
@@ -799,7 +839,7 @@
799
839
  },
800
840
  {
801
841
  "comment": "(default|*|name) as alias",
802
- "match": "(?x) (?: \\b(default)\\b | (\\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \\s+ (as) \\s+ (?: (\\b default \\b | \\*) | ([_$[:alpha:]][_$[:alnum:]]*))",
842
+ "match": "(?x) (?: \\b(default)\\b | (\\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \\s+ \n (as) \\s+ (?: (\\b default \\b | \\*) | ([_$[:alpha:]][_$[:alnum:]]*))",
803
843
  "captures": {
804
844
  "1": {
805
845
  "name": "keyword.control.default.ts"
@@ -908,7 +948,7 @@
908
948
  "include": "#type-parameters"
909
949
  },
910
950
  {
911
- "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)",
951
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*([,<{]|extends|implements|//|/\\*))",
912
952
  "captures": {
913
953
  "1": {
914
954
  "name": "entity.name.type.module.ts"
@@ -919,12 +959,15 @@
919
959
  }
920
960
  },
921
961
  {
922
- "match": "([_$[:alpha:]][_$[:alnum:]]*)",
962
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*([,<{]|extends|implements|//|/\\*))",
923
963
  "captures": {
924
964
  "1": {
925
965
  "name": "entity.other.inherited-class.ts"
926
966
  }
927
967
  }
968
+ },
969
+ {
970
+ "include": "#expression"
928
971
  }
929
972
  ]
930
973
  },
@@ -1014,6 +1057,9 @@
1014
1057
  {
1015
1058
  "include": "#indexer-declaration"
1016
1059
  },
1060
+ {
1061
+ "include": "#indexer-mapped-type-declaration"
1062
+ },
1017
1063
  {
1018
1064
  "include": "#field-declaration"
1019
1065
  },
@@ -1039,12 +1085,15 @@
1039
1085
  },
1040
1086
  {
1041
1087
  "include": "#punctuation-semicolon"
1088
+ },
1089
+ {
1090
+ "include": "#type"
1042
1091
  }
1043
1092
  ]
1044
1093
  },
1045
1094
  "field-declaration": {
1046
1095
  "name": "meta.field.declaration.ts",
1047
- "begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\?\\s*)?(=|:))",
1096
+ "begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\?\\s*)?(=|:))",
1048
1097
  "beginCaptures": {
1049
1098
  "1": {
1050
1099
  "name": "storage.modifier.ts"
@@ -1056,7 +1105,7 @@
1056
1105
  "include": "#variable-initializer"
1057
1106
  },
1058
1107
  {
1059
- "begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\?\\s*)?(=|:))",
1108
+ "begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\?\\s*)?(=|:))",
1060
1109
  "end": "(?=[};,=]|$)|(?<=\\})",
1061
1110
  "patterns": [
1062
1111
  {
@@ -1071,6 +1120,10 @@
1071
1120
  {
1072
1121
  "include": "#comment"
1073
1122
  },
1123
+ {
1124
+ "name": "meta.definition.property.ts entity.name.function.ts",
1125
+ "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s*\n (=\\s*(\n (async\\s+) |\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))\n ) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )))\n )\n)"
1126
+ },
1074
1127
  {
1075
1128
  "name": "meta.definition.property.ts variable.object.property.ts",
1076
1129
  "match": "[_$[:alpha:]][_$[:alnum:]]*"
@@ -1085,7 +1138,7 @@
1085
1138
  },
1086
1139
  "method-declaration": {
1087
1140
  "name": "meta.method.declaration.ts",
1088
- "begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\??))?\\s*[\\(\\<]))",
1141
+ "begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\s*[\\(\\<]))",
1089
1142
  "beginCaptures": {
1090
1143
  "1": {
1091
1144
  "name": "storage.modifier.ts"
@@ -1135,7 +1188,7 @@
1135
1188
  ]
1136
1189
  },
1137
1190
  "method-overload-declaration": {
1138
- "begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\??))?\\s*[\\(\\<]))",
1191
+ "begin": "(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\s*[\\(\\<]))",
1139
1192
  "beginCaptures": {
1140
1193
  "1": {
1141
1194
  "name": "storage.modifier.ts"
@@ -1167,7 +1220,7 @@
1167
1220
  ]
1168
1221
  },
1169
1222
  "method-declaration-name": {
1170
- "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[[^\\]]*\\]))\\s*(\\??)\\s*[\\(\\<])",
1223
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??)\\s*[\\(\\<])",
1171
1224
  "end": "(?=\\(|\\<)",
1172
1225
  "patterns": [
1173
1226
  {
@@ -1186,6 +1239,65 @@
1186
1239
  }
1187
1240
  ]
1188
1241
  },
1242
+ "object-literal-method-declaration": {
1243
+ "name": "meta.method.declaration.ts",
1244
+ "begin": "(?<!\\.|\\$)(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\s*[\\(\\<])",
1245
+ "beginCaptures": {
1246
+ "1": {
1247
+ "name": "storage.modifier.async.ts"
1248
+ },
1249
+ "2": {
1250
+ "name": "storage.type.property.ts"
1251
+ },
1252
+ "3": {
1253
+ "name": "keyword.generator.asterisk.ts"
1254
+ }
1255
+ },
1256
+ "end": "(?=\\}|;|,)|(?<=\\})",
1257
+ "patterns": [
1258
+ {
1259
+ "include": "#method-declaration-name"
1260
+ },
1261
+ {
1262
+ "include": "#comment"
1263
+ },
1264
+ {
1265
+ "include": "#type-parameters"
1266
+ },
1267
+ {
1268
+ "include": "#function-parameters"
1269
+ },
1270
+ {
1271
+ "include": "#return-type"
1272
+ },
1273
+ {
1274
+ "include": "#method-overload-declaration"
1275
+ },
1276
+ {
1277
+ "include": "#decl-block"
1278
+ }
1279
+ ]
1280
+ },
1281
+ "object-literal-method-overload-declaration": {
1282
+ "begin": "(?<!\\.|\\$)(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(\\??))?\\s*[\\(\\<])",
1283
+ "beginCaptures": {
1284
+ "1": {
1285
+ "name": "storage.modifier.async.ts"
1286
+ },
1287
+ "2": {
1288
+ "name": "storage.type.property.ts"
1289
+ },
1290
+ "3": {
1291
+ "name": "keyword.generator.asterisk.ts"
1292
+ }
1293
+ },
1294
+ "end": "(?=\\(|\\<)",
1295
+ "patterns": [
1296
+ {
1297
+ "include": "#method-declaration-name"
1298
+ }
1299
+ ]
1300
+ },
1189
1301
  "indexer-declaration": {
1190
1302
  "name": "meta.indexer.declaration.ts",
1191
1303
  "begin": "(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:)",
@@ -1215,6 +1327,38 @@
1215
1327
  }
1216
1328
  ]
1217
1329
  },
1330
+ "indexer-mapped-type-declaration": {
1331
+ "name": "meta.indexer.mappedtype.declaration.ts",
1332
+ "begin": "(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s+(in)\\s+",
1333
+ "beginCaptures": {
1334
+ "1": {
1335
+ "name": "storage.modifier.ts"
1336
+ },
1337
+ "2": {
1338
+ "name": "meta.brace.square.ts"
1339
+ },
1340
+ "3": {
1341
+ "name": "entity.name.type.ts"
1342
+ },
1343
+ "4": {
1344
+ "name": "keyword.operator.expression.in.ts"
1345
+ }
1346
+ },
1347
+ "end": "(\\])\\s*(\\?\\s*)?|$",
1348
+ "endCaptures": {
1349
+ "1": {
1350
+ "name": "meta.brace.square.ts"
1351
+ },
1352
+ "2": {
1353
+ "name": "keyword.operator.optional.ts"
1354
+ }
1355
+ },
1356
+ "patterns": [
1357
+ {
1358
+ "include": "#type"
1359
+ }
1360
+ ]
1361
+ },
1218
1362
  "function-declaration": {
1219
1363
  "name": "meta.function.ts",
1220
1364
  "begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
@@ -1339,24 +1483,50 @@
1339
1483
  ]
1340
1484
  },
1341
1485
  "parameter-name": {
1342
- "match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
1343
- "captures": {
1344
- "1": {
1345
- "name": "storage.modifier.ts"
1346
- },
1347
- "2": {
1348
- "name": "storage.modifier.ts"
1349
- },
1350
- "3": {
1351
- "name": "keyword.operator.rest.ts"
1486
+ "patterns": [
1487
+ {
1488
+ "match": "\\s*\\b(public|protected|private|readonly)(?=\\s+(public|protected|private|readonly)\\s+)",
1489
+ "captures": {
1490
+ "1": {
1491
+ "name": "storage.modifier.ts"
1492
+ }
1493
+ }
1352
1494
  },
1353
- "4": {
1354
- "name": "variable.parameter.ts"
1495
+ {
1496
+ "match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s*\n (=\\s*(\n (async\\s+) |\n (function\\s*[(<]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) |\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))\n ) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )))\n )\n)",
1497
+ "captures": {
1498
+ "1": {
1499
+ "name": "storage.modifier.ts"
1500
+ },
1501
+ "2": {
1502
+ "name": "keyword.operator.rest.ts"
1503
+ },
1504
+ "3": {
1505
+ "name": "entity.name.function.ts"
1506
+ },
1507
+ "4": {
1508
+ "name": "keyword.operator.optional.ts"
1509
+ }
1510
+ }
1355
1511
  },
1356
- "5": {
1357
- "name": "keyword.operator.optional.ts"
1512
+ {
1513
+ "match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
1514
+ "captures": {
1515
+ "1": {
1516
+ "name": "storage.modifier.ts"
1517
+ },
1518
+ "2": {
1519
+ "name": "keyword.operator.rest.ts"
1520
+ },
1521
+ "3": {
1522
+ "name": "variable.parameter.ts"
1523
+ },
1524
+ "4": {
1525
+ "name": "keyword.operator.optional.ts"
1526
+ }
1527
+ }
1358
1528
  }
1359
- }
1529
+ ]
1360
1530
  },
1361
1531
  "destructuring-parameter": {
1362
1532
  "patterns": [
@@ -1396,7 +1566,10 @@
1396
1566
  },
1397
1567
  "patterns": [
1398
1568
  {
1399
- "include": "#parameter-array-binding-element"
1569
+ "include": "#parameter-binding-element"
1570
+ },
1571
+ {
1572
+ "include": "#punctuation-comma"
1400
1573
  }
1401
1574
  ]
1402
1575
  }
@@ -1408,29 +1581,14 @@
1408
1581
  "include": "#comment"
1409
1582
  },
1410
1583
  {
1411
- "begin": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
1412
- "beginCaptures": {
1413
- "1": {
1414
- "name": "variable.object.property.ts"
1415
- },
1416
- "2": {
1417
- "name": "punctuation.destructuring.ts"
1418
- }
1419
- },
1584
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(:))",
1420
1585
  "end": "(?=,|\\})",
1421
1586
  "patterns": [
1422
1587
  {
1423
- "include": "#parameter-object-binding-pattern"
1424
- },
1425
- {
1426
- "include": "#parameter-array-binding-pattern"
1588
+ "include": "#object-binding-element-propertyName"
1427
1589
  },
1428
1590
  {
1429
- "name": "variable.parameter.ts",
1430
- "match": "([_$[:alpha:]][_$[:alnum:]]*)"
1431
- },
1432
- {
1433
- "include": "#variable-initializer"
1591
+ "include": "#parameter-binding-element"
1434
1592
  }
1435
1593
  ]
1436
1594
  },
@@ -1448,7 +1606,7 @@
1448
1606
  }
1449
1607
  ]
1450
1608
  },
1451
- "parameter-array-binding-element": {
1609
+ "parameter-binding-element": {
1452
1610
  "patterns": [
1453
1611
  {
1454
1612
  "include": "#comment"
@@ -1464,9 +1622,6 @@
1464
1622
  },
1465
1623
  {
1466
1624
  "include": "#variable-initializer"
1467
- },
1468
- {
1469
- "include": "#punctuation-comma"
1470
1625
  }
1471
1626
  ]
1472
1627
  },
@@ -1521,7 +1676,10 @@
1521
1676
  },
1522
1677
  "patterns": [
1523
1678
  {
1524
- "include": "#parameter-array-binding-element"
1679
+ "include": "#parameter-binding-element"
1680
+ },
1681
+ {
1682
+ "include": "#punctuation-comma"
1525
1683
  }
1526
1684
  ]
1527
1685
  },
@@ -1681,9 +1839,9 @@
1681
1839
  },
1682
1840
  "type-paren-or-function-parameters": {
1683
1841
  "name": "meta.type.paren.cover.ts",
1684
- "begin": "\\s*(\\()",
1842
+ "begin": "\\(",
1685
1843
  "beginCaptures": {
1686
- "1": {
1844
+ "0": {
1687
1845
  "name": "meta.brace.round.ts"
1688
1846
  }
1689
1847
  },
@@ -1740,7 +1898,7 @@
1740
1898
  },
1741
1899
  {
1742
1900
  "name": "meta.type.function.ts",
1743
- "begin": "(?x)( \\s* (?= [(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )",
1901
+ "begin": "(?x)(\n (?=\n [(]\\s*(\n ([)]) | \n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n )\n )\n)",
1744
1902
  "end": "(?<=\\))",
1745
1903
  "patterns": [
1746
1904
  {
@@ -1758,6 +1916,10 @@
1758
1916
  {
1759
1917
  "name": "keyword.operator.type.ts",
1760
1918
  "match": "[&|]"
1919
+ },
1920
+ {
1921
+ "name": "keyword.operator.expression.keyof.ts",
1922
+ "match": "(?<!\\.|\\$)\\bkeyof\\b(?!\\$)"
1761
1923
  }
1762
1924
  ]
1763
1925
  },
@@ -1889,12 +2051,15 @@
1889
2051
  ]
1890
2052
  },
1891
2053
  "for-loop": {
1892
- "begin": "(?<!\\.|\\$)\\b(for)\\s*(\\()",
2054
+ "begin": "(?<!\\.|\\$)\\b(for)(?:\\s+(await))?\\s*(\\()",
1893
2055
  "beginCaptures": {
1894
2056
  "1": {
1895
2057
  "name": "keyword.control.loop.ts"
1896
2058
  },
1897
2059
  "2": {
2060
+ "name": "keyword.control.loop.ts"
2061
+ },
2062
+ "3": {
1898
2063
  "name": "meta.brace.round.ts"
1899
2064
  }
1900
2065
  },
@@ -1941,7 +2106,7 @@
1941
2106
  },
1942
2107
  "switch-block": {
1943
2108
  "name": "switch-block.expr.ts",
1944
- "begin": "{",
2109
+ "begin": "\\{",
1945
2110
  "beginCaptures": {
1946
2111
  "0": {
1947
2112
  "name": "punctuation.definition.block.ts"
@@ -1980,7 +2145,7 @@
1980
2145
  "switch-statement": {
1981
2146
  "name": "switch-statement.expr.ts",
1982
2147
  "begin": "(?<!\\.|\\$)(?=\\bswitch\\s*\\()",
1983
- "end": "}",
2148
+ "end": "\\}",
1984
2149
  "endCaptures": {
1985
2150
  "0": {
1986
2151
  "name": "punctuation.definition.block.ts"
@@ -2003,7 +2168,7 @@
2003
2168
  },
2004
2169
  {
2005
2170
  "name": "support.class.builtin.ts",
2006
- "match": "(?x)(?<!\\.|\\$)\\b(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Promise|Proxy |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\\b(?!\\$)"
2171
+ "match": "(?x)(?<!\\.|\\$)\\b(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator\n |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Promise|Proxy\n |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray\n |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\\b(?!\\$)"
2007
2172
  },
2008
2173
  {
2009
2174
  "name": "support.class.error.ts",
@@ -2011,7 +2176,7 @@
2011
2176
  },
2012
2177
  {
2013
2178
  "name": "support.function.ts",
2014
- "match": "(?x)(?<!\\.|\\$)\\b(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval| isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\\s*\\()"
2179
+ "match": "(?x)(?<!\\.|\\$)\\b(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|\n isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\\s*\\() "
2015
2180
  },
2016
2181
  {
2017
2182
  "match": "(?x)(?<!\\.|\\$)\\b(Math)(?:\\s*(\\.)\\s*(?:\n (abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|\n expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|\n round|sign|sin|sinh|sqrt|tan|tanh|trunc)\n |\n (E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)))?\\b(?!\\$)",
@@ -2163,17 +2328,19 @@
2163
2328
  ]
2164
2329
  },
2165
2330
  "function-call": {
2166
- "begin": "(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
2167
- "beginCaptures": {
2168
- "1": {
2169
- "name": "punctuation.accessor.ts"
2170
- },
2171
- "2": {
2172
- "name": "entity.name.function.ts"
2173
- }
2174
- },
2175
- "end": "(?<=\\))",
2331
+ "begin": "(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
2332
+ "end": "(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
2176
2333
  "patterns": [
2334
+ {
2335
+ "include": "#support-objects"
2336
+ },
2337
+ {
2338
+ "include": "#punctuation-accessor"
2339
+ },
2340
+ {
2341
+ "name": "entity.name.function.ts",
2342
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
2343
+ },
2177
2344
  {
2178
2345
  "include": "#comment"
2179
2346
  },
@@ -2218,7 +2385,7 @@
2218
2385
  "name": "punctuation.accessor.ts"
2219
2386
  },
2220
2387
  "2": {
2221
- "name": "constant.other.object.property.ts"
2388
+ "name": "variable.other.constant.object.property.ts"
2222
2389
  },
2223
2390
  "3": {
2224
2391
  "name": "variable.other.object.property.ts"
@@ -2226,7 +2393,7 @@
2226
2393
  }
2227
2394
  },
2228
2395
  {
2229
- "match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*( (async\\s+)|(function\\s+)| ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)| ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))",
2396
+ "match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(\n (async\\s+)|(function\\s*[(<])|(function\\s+)|\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))",
2230
2397
  "captures": {
2231
2398
  "1": {
2232
2399
  "name": "punctuation.accessor.ts"
@@ -2243,7 +2410,7 @@
2243
2410
  "name": "punctuation.accessor.ts"
2244
2411
  },
2245
2412
  "2": {
2246
- "name": "constant.other.property.ts"
2413
+ "name": "variable.other.constant.property.ts"
2247
2414
  }
2248
2415
  }
2249
2416
  },
@@ -2262,7 +2429,7 @@
2262
2429
  "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
2263
2430
  "captures": {
2264
2431
  "1": {
2265
- "name": "constant.other.object.ts"
2432
+ "name": "variable.other.constant.object.ts"
2266
2433
  },
2267
2434
  "2": {
2268
2435
  "name": "variable.other.object.ts"
@@ -2270,7 +2437,7 @@
2270
2437
  }
2271
2438
  },
2272
2439
  {
2273
- "name": "constant.other.ts",
2440
+ "name": "variable.other.constant.ts",
2274
2441
  "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
2275
2442
  },
2276
2443
  {
@@ -2281,13 +2448,13 @@
2281
2448
  },
2282
2449
  "cast": {
2283
2450
  "name": "cast.expr.ts",
2284
- "begin": "(?:(?<=return|throw|yield|await|default|[=(,:>*]))\\s*(<)(?!<?\\=)",
2451
+ "begin": "(?:(?<=return|throw|yield|await|default|^|[=(,:>*]))\\s*(<)(?!<?\\=)",
2285
2452
  "beginCaptures": {
2286
2453
  "1": {
2287
2454
  "name": "meta.brace.angle.ts"
2288
2455
  }
2289
2456
  },
2290
- "end": ">",
2457
+ "end": "\\>",
2291
2458
  "endCaptures": {
2292
2459
  "0": {
2293
2460
  "name": "meta.brace.angle.ts"
@@ -2312,6 +2479,9 @@
2312
2479
  {
2313
2480
  "include": "#paren-expression"
2314
2481
  },
2482
+ {
2483
+ "include": "#class-or-interface-declaration"
2484
+ },
2315
2485
  {
2316
2486
  "include": "#type"
2317
2487
  }
@@ -2323,16 +2493,16 @@
2323
2493
  "include": "#comment"
2324
2494
  },
2325
2495
  {
2326
- "include": "#method-declaration"
2496
+ "include": "#object-literal-method-declaration"
2327
2497
  },
2328
2498
  {
2329
2499
  "name": "meta.object.member.ts",
2330
- "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[[^\\]]*\\]))\\s*:)",
2500
+ "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*:)",
2331
2501
  "end": "(?=,|\\})",
2332
2502
  "patterns": [
2333
2503
  {
2334
2504
  "name": "meta.object-literal.key.ts",
2335
- "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[[^\\]]*\\]))\\s*:)",
2505
+ "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*:)",
2336
2506
  "end": ":",
2337
2507
  "endCaptures": {
2338
2508
  "0": {
@@ -2355,7 +2525,7 @@
2355
2525
  },
2356
2526
  {
2357
2527
  "name": "meta.object.member.ts",
2358
- "begin": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)(?=\\s*( (async\\s+)|(function\\s+)| ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)| ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))))",
2528
+ "begin": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)(?=\\s*(\n (async\\s+)|(function\\s*[(<])|(function\\s+)|\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|\n ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))))",
2359
2529
  "beginCaptures": {
2360
2530
  "0": {
2361
2531
  "name": "meta.object-literal.key.ts"
@@ -2515,6 +2685,14 @@
2515
2685
  {
2516
2686
  "name": "keyword.operator.arithmetic.ts",
2517
2687
  "match": "%|\\*|/|-|\\+"
2688
+ },
2689
+ {
2690
+ "match": "(?<=[_$[:alnum:])])\\s*(/)(?![/*])",
2691
+ "captures": {
2692
+ "1": {
2693
+ "name": "keyword.operator.arithmetic.ts"
2694
+ }
2695
+ }
2518
2696
  }
2519
2697
  ]
2520
2698
  },
@@ -2686,7 +2864,7 @@
2686
2864
  "patterns": [
2687
2865
  {
2688
2866
  "name": "string.regex.ts",
2689
- "begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*+?])(?=.*/)",
2867
+ "begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
2690
2868
  "beginCaptures": {
2691
2869
  "1": {
2692
2870
  "name": "punctuation.definition.string.begin.ts"
@@ -2709,7 +2887,7 @@
2709
2887
  },
2710
2888
  {
2711
2889
  "name": "string.regex.ts",
2712
- "begin": "/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
2890
+ "begin": "(?<![_$[:alnum:]])/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
2713
2891
  "beginCaptures": {
2714
2892
  "0": {
2715
2893
  "name": "punctuation.definition.string.begin.ts"
@@ -2875,7 +3053,6 @@
2875
3053
  ]
2876
3054
  },
2877
3055
  "string": {
2878
- "name": "string.ts",
2879
3056
  "patterns": [
2880
3057
  {
2881
3058
  "include": "#qstring-single"
@@ -3082,8 +3259,13 @@
3082
3259
  {
3083
3260
  "name": "comment.block.documentation.ts",
3084
3261
  "begin": "/\\*\\*(?!/)",
3262
+ "beginCaptures": {
3263
+ "0": {
3264
+ "name": "punctuation.definition.comment.ts"
3265
+ }
3266
+ },
3085
3267
  "end": "\\*/",
3086
- "captures": {
3268
+ "endCaptures": {
3087
3269
  "0": {
3088
3270
  "name": "punctuation.definition.comment.ts"
3089
3271
  }
@@ -3097,8 +3279,13 @@
3097
3279
  {
3098
3280
  "name": "comment.block.ts",
3099
3281
  "begin": "/\\*",
3282
+ "beginCaptures": {
3283
+ "0": {
3284
+ "name": "punctuation.definition.comment.ts"
3285
+ }
3286
+ },
3100
3287
  "end": "\\*/",
3101
- "captures": {
3288
+ "endCaptures": {
3102
3289
  "0": {
3103
3290
  "name": "punctuation.definition.comment.ts"
3104
3291
  }
@@ -3127,14 +3314,75 @@
3127
3314
  }
3128
3315
  ]
3129
3316
  },
3317
+ "directives": {
3318
+ "name": "comment.line.triple-slash.directive.ts",
3319
+ "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)",
3320
+ "beginCaptures": {
3321
+ "1": {
3322
+ "name": "punctuation.definition.comment.ts"
3323
+ }
3324
+ },
3325
+ "end": "(?=$)",
3326
+ "patterns": [
3327
+ {
3328
+ "name": "meta.tag.ts",
3329
+ "begin": "(<)(reference|amd-dependency|amd-module)",
3330
+ "beginCaptures": {
3331
+ "1": {
3332
+ "name": "punctuation.definition.tag.directive.ts"
3333
+ },
3334
+ "2": {
3335
+ "name": "entity.name.tag.directive.ts"
3336
+ }
3337
+ },
3338
+ "end": "/>",
3339
+ "endCaptures": {
3340
+ "0": {
3341
+ "name": "punctuation.definition.tag.directive.ts"
3342
+ }
3343
+ },
3344
+ "patterns": [
3345
+ {
3346
+ "name": "entity.other.attribute-name.directive.ts",
3347
+ "match": "path|types|no-default-lib|name"
3348
+ },
3349
+ {
3350
+ "name": "keyword.operator.assignment.ts",
3351
+ "match": "="
3352
+ },
3353
+ {
3354
+ "include": "#string"
3355
+ }
3356
+ ]
3357
+ }
3358
+ ]
3359
+ },
3130
3360
  "docblock": {
3131
3361
  "patterns": [
3132
3362
  {
3133
3363
  "name": "storage.type.class.jsdoc",
3134
- "match": "(?<!\\w)@(abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extensionfor|external|file|fileoverview|final|fires|for|function|global|host|ignore|implements|inherit[Dd]oc|inner|instance|interface|kind|lends|license|listens|main|member|memberof|method|mixex|mixins?|module|name|namespace|nocollapse|nosideeffects|override|overview|package|param|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce)\\b"
3364
+ "match": "(?x)(?<!\\w)@(\n abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class\n |classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc\n |description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extensionfor|external|file\n |fileoverview|final|fires|for|function|global|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance\n |interface|kind|lends|license|listens|main|member|memberof|method|mixex|mixins?|modifies|module|name|namespace\n |noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|preserve|private|prop|property\n |protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress\n |template|this|throws|todo|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce)\\b"
3365
+ },
3366
+ {
3367
+ "name": "other.meta.jsdoc",
3368
+ "match": "(?x)\n(\n \\[\n [^\\]]+ # Optional [link text] preceding {@link syntax}\n \\]\n\n (?! # Check to avoid highlighting two sets of link text\n {\n @\\w+ # Tagname\n \\s+\n [^\\s|}]+ # Namepath/URL\n [\\s|] # Whitespace or bar delimiting description\n [^}]*\n }\n )\n)?\n\n(?:\n {\n (\n @\n (?: link # Name of tag\n | linkcode\n | linkplain\n | tutorial\n )\n )\n\n \\s+\n\n ([^\\s|}]+) # Namepath or URL\n\n (?: # Optional link text following link target\n [\\s|] # Bar or space separating target and text\n [^}]* # Actual text\n )?\n }\n)",
3369
+ "captures": {
3370
+ "0": {
3371
+ "name": "entity.name.type.instance.jsdoc"
3372
+ },
3373
+ "1": {
3374
+ "name": "constant.other.description.jsdoc"
3375
+ },
3376
+ "2": {
3377
+ "name": "storage.type.class.jsdoc"
3378
+ },
3379
+ "3": {
3380
+ "name": "variable.other.description.jsdoc"
3381
+ }
3382
+ }
3135
3383
  },
3136
3384
  {
3137
- "match": "(?x)\n(?:(?<=@param)|(?<=@arg)|(?<=@argument)|(?<=@type))\n\\s+\n({(?:\n \\* | # {*} any type\n \\? | # {?} unknown type\n (?: # Check for a prefix\n \\? | # {?string} nullable type\n ! | # {!string} non-nullable type\n \\.{3} # {...string} variable number of parameters\n )?\n (?:\n \\( # Opening bracket of multiple types with parenthesis {(string|number)}\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string[]|number)} type application, an array of strings or a number\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string|number[])} type application, a string or an array of numbers\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n \\) |\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {string[]|number} type application, an array of strings or a number\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n )\n # Check for suffix\n (?:\\[\\])? # {string[]} type application, an array of strings\n =? # {string=} optional parameter\n)})\n\\s+\n(\n \\[ # [foo] optional parameter\n \\s*\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n (?:\\[\\])? # Foo[].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [a-zA-Z_$][\\w$]*\n )*\n (?:\n \\s*\n = # [foo=bar] Default parameter value\n \\s*\n [\\w$\\s]*\n )?\n )\n \\s*\n \\] |\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n (?:\\[\\])? # Foo[].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [a-zA-Z_$][\\w$]*\n )*\n )?\n)\n\\s+\n(?:-\\s+)? # optional hyphen before the description\n((?:(?!\\*\\/).)*) # The type description",
3385
+ "match": "(?x)\n\n(?:(?<=@param)|(?<=@arg)|(?<=@argument)|(?<=@type)|(?<=@property)|(?<=@prop))\n\n\\s+\n\n({(?:\n \\* | # {*} any type\n \\? | # {?} unknown type\n\n (?:\n (?: # Check for a prefix\n \\? | # {?string} nullable type\n ! | # {!string} non-nullable type\n \\.{3} # {...string} variable number of parameters\n )?\n\n (?:\n (?:\n function # {function(string, number)} function type\n \\s*\n \\(\n \\s*\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n \\s*,\\s*\n [a-zA-Z_$][\\w$]*\n )*\n )?\n \\s*\n \\)\n (?: # {function(): string} function return type\n \\s*:\\s*\n [a-zA-Z_$][\\w$]*\n )?\n )?\n |\n (?:\n \\( # Opening bracket of multiple types with parenthesis {(string|number)}\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string[]|number)} type application, an array of strings or a number\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string|number[])} type application, a string or an array of numbers\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n \\) |\n [a-zA-Z_$]+\n (?:\n (?:\n [\\w$]*\n (?:\\[\\])? # {(string|number[])} type application, a string or an array of numbers\n ) |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n )\n )\n # Check for suffix\n (?:\\[\\])? # {string[]} type application, an array of strings\n =? # {string=} optional parameter\n )\n)})\n\n\\s+\n\n(\n \\[ # [foo] optional parameter\n \\s*\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n (?:\\[\\])? # Foo[].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [a-zA-Z_$][\\w$]*\n )*\n (?:\n \\s*\n = # [foo=bar] Default parameter value\n \\s*\n [\\w$\\s]*\n )?\n )\n \\s*\n \\] |\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n (?:\\[\\])? # Foo[].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [a-zA-Z_$][\\w$]*\n )*\n )?\n)\n\n\\s+\n\n(?:-\\s+)? # optional hyphen before the description\n\n((?:(?!\\*\\/).)*) # The type description",
3138
3386
  "captures": {
3139
3387
  "0": {
3140
3388
  "name": "other.meta.jsdoc"
@@ -3151,7 +3399,7 @@
3151
3399
  }
3152
3400
  },
3153
3401
  {
3154
- "match": "(?x)\n({(?:\n \\* | # {*} any type\n \\? | # {?} unknown type\n\n (?: # Check for a prefix\n \\? | # {?string} nullable type\n ! | # {!string} non-nullable type\n \\.{3} # {...string} variable number of parameters\n )?\n\n (?:\n \\( # Opening bracket of multiple types with parenthesis {(string|number)}\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n \\) |\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n )\n # Check for suffix\n (?:\\[\\])? # {string[]} type application, an array of strings\n =? # {string=} optional parameter\n)})\n\\s+\n(?:-\\s+)? # optional hyphen before the description\n((?:(?!\\*\\/).)*) # The type description",
3402
+ "match": "(?x)\n\n({(?:\n \\* | # {*} any type\n \\? | # {?} unknown type\n\n (?:\n (?: # Check for a prefix\n \\? | # {?string} nullable type\n ! | # {!string} non-nullable type\n \\.{3} # {...string} variable number of parameters\n )?\n\n (?:\n (?:\n function # {function(string, number)} function type\n \\s*\n \\(\n \\s*\n (?:\n [a-zA-Z_$][\\w$]*\n (?:\n \\s*,\\s*\n [a-zA-Z_$][\\w$]*\n )*\n )?\n \\s*\n \\)\n (?: # {function(): string} function return type\n \\s*:\\s*\n [a-zA-Z_$][\\w$]*\n )?\n )?\n |\n (?:\n \\( # Opening bracket of multiple types with parenthesis {(string|number)}\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n \\) |\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n (?:\n [\\.|~] # {Foo.bar} namespaced, {string|number} multiple, {Foo~bar} class-specific callback\n [a-zA-Z_$]+\n (?:\n [\\w$]* |\n \\.?<[\\w$]+(?:,\\s+[\\w$]+)*> # {Array<string>} or {Object<string, number>} type application (optional .)\n )\n )*\n )\n )\n # Check for suffix\n (?:\\[\\])? # {string[]} type application, an array of strings\n =? # {string=} optional parameter\n )\n)})\n\n\\s+\n\n(?:-\\s+)? # optional hyphen before the description\n\n((?:(?!\\*\\/).)*) # The type description",
3155
3403
  "captures": {
3156
3404
  "0": {
3157
3405
  "name": "other.meta.jsdoc"