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
@@ -1,290 +1,916 @@
1
1
  {
2
- "scopeName": "source.graphql",
3
2
  "name": "GraphQL",
3
+ "scopeName": "source.graphql",
4
+ "foldingStartMarker": "(/\\*|{|\\()",
5
+ "foldingEndMarker": "(\\*/|\\}|\\))",
4
6
  "fileTypes": [
5
7
  "graphql",
6
- "GraphQL"
8
+ "gql"
7
9
  ],
8
- "foldingStartMarker": "{([",
9
- "foldingStopMarker": "})]",
10
10
  "patterns": [
11
11
  {
12
- "include": "#comment"
13
- },
14
- {
15
- "include": "#typeDef"
16
- },
17
- {
18
- "include": "#typeDefImplements"
19
- },
20
- {
21
- "include": "#unionOptions"
12
+ "include": "#graphql"
13
+ }
14
+ ],
15
+ "repository": {
16
+ "graphql": {
17
+ "patterns": [
18
+ {
19
+ "include": "#graphql-fragment-definition"
20
+ },
21
+ {
22
+ "include": "#graphql-type-interface"
23
+ },
24
+ {
25
+ "include": "#graphql-enum"
26
+ },
27
+ {
28
+ "include": "#graphql-scalar"
29
+ },
30
+ {
31
+ "include": "#graphql-union"
32
+ },
33
+ {
34
+ "include": "#graphql-schema"
35
+ },
36
+ {
37
+ "include": "#graphql-operation-def"
38
+ },
39
+ {
40
+ "include": "#graphql-comment"
41
+ }
42
+ ]
22
43
  },
23
- {
24
- "include": "#directive"
44
+ "graphql-operation-def": {
45
+ "patterns": [
46
+ {
47
+ "include": "#graphql-query-mutation"
48
+ },
49
+ {
50
+ "include": "#graphql-name"
51
+ },
52
+ {
53
+ "include": "#graphql-variable-definitions"
54
+ },
55
+ {
56
+ "include": "#graphql-directive"
57
+ },
58
+ {
59
+ "include": "#graphql-selection-set"
60
+ }
61
+ ]
25
62
  },
26
- {
27
- "name": "meta.fragment",
28
- "comment": "a fragment definintion",
29
- "match": "(fragment)\\s*([_A-Za-z][_0-9A-Za-z]*)\\s*(on)\\s*([_A-Za-z][_0-9A-Za-z]*)",
63
+ "graphql-fragment-definition": {
64
+ "name": "meta.fragment.graphql",
65
+ "begin": "\\s*(?:(\\bfragment\\b)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)))",
66
+ "end": "(?<=})",
30
67
  "captures": {
31
68
  "1": {
32
- "name": "storage.type"
69
+ "name": "keyword.fragment.graphql"
33
70
  },
34
71
  "2": {
35
- "name": "variable.other"
72
+ "name": "entity.name.fragment.graphql"
36
73
  },
37
74
  "3": {
38
- "name": "keyword.operator"
75
+ "name": "keyword.on.graphql"
39
76
  },
40
77
  "4": {
41
- "name": "support.class"
78
+ "name": "support.type.graphql"
79
+ }
80
+ },
81
+ "patterns": [
82
+ {
83
+ "include": "#graphql-comment"
84
+ },
85
+ {
86
+ "include": "#graphql-selection-set"
87
+ },
88
+ {
89
+ "include": "#graphql-directive"
90
+ },
91
+ {
92
+ "include": "#graphql-skip-newlines"
93
+ }
94
+ ]
95
+ },
96
+ "graphql-query-mutation": {
97
+ "match": "\\s*\\b(query|mutation)\\b",
98
+ "captures": {
99
+ "1": {
100
+ "name": "keyword.operation.graphql"
42
101
  }
43
102
  }
44
103
  },
45
- {
46
- "name": "meta.operation",
47
- "comment": "an operation definition",
48
- "match": "(query|mutation|subscription)\\s*([_A-Za-z][_0-9A-Za-z]*)",
104
+ "graphql-type-interface": {
105
+ "name": "meta.type.interface.graphql",
106
+ "begin": "\\s*\\b(?:(extends)?\\b\\s*\\b(type)|(interface)|(input))\\b\\s*([_A-Za-z][_0-9A-Za-z]*)?",
107
+ "end": "(?<=})",
49
108
  "captures": {
50
109
  "1": {
51
- "name": "storage.type"
110
+ "name": "keyword.type.graphql"
52
111
  },
53
112
  "2": {
54
- "name": "variable.other"
113
+ "name": "keyword.type.graphql"
114
+ },
115
+ "3": {
116
+ "name": "keyword.interface.graphql"
117
+ },
118
+ "4": {
119
+ "name": "keyword.input.graphql"
120
+ },
121
+ "5": {
122
+ "name": "support.type.graphql"
123
+ }
124
+ },
125
+ "patterns": [
126
+ {
127
+ "match": "\\s*\\b(implements)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)",
128
+ "captures": {
129
+ "1": {
130
+ "name": "keyword.implements.grapahql"
131
+ },
132
+ "2": {
133
+ "name": "support.type.graphql"
134
+ }
135
+ }
136
+ },
137
+ {
138
+ "include": "#graphql-comment"
139
+ },
140
+ {
141
+ "include": "#graphql-type-object"
142
+ }
143
+ ]
144
+ },
145
+ "graphql-type-object": {
146
+ "name": "meta.type.object.graphql",
147
+ "begin": "\\s*({)",
148
+ "end": "\\s*(})",
149
+ "beginCaptures": {
150
+ "1": {
151
+ "name": "punctuation.operation.graphql"
152
+ }
153
+ },
154
+ "endCaptures": {
155
+ "1": {
156
+ "name": "punctuation.operation.graphql"
157
+ }
158
+ },
159
+ "patterns": [
160
+ {
161
+ "include": "#graphql-object-type"
162
+ },
163
+ {
164
+ "include": "#graphql-comment"
165
+ },
166
+ {
167
+ "include": "#graphql-type-definition"
168
+ }
169
+ ]
170
+ },
171
+ "graphql-type-definition": {
172
+ "comment": "key (optionalArgs): Type",
173
+ "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)",
174
+ "end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)",
175
+ "beginCaptures": {
176
+ "1": {
177
+ "name": "variable.graphql"
178
+ }
179
+ },
180
+ "endCaptures": {
181
+ "5": {
182
+ "name": "punctuation.comma.graphql"
183
+ }
184
+ },
185
+ "patterns": [
186
+ {
187
+ "include": "#graphql-comment"
188
+ },
189
+ {
190
+ "include": "#graphql-variable-definitions"
191
+ },
192
+ {
193
+ "include": "#graphql-type-object"
194
+ },
195
+ {
196
+ "include": "#graphql-colon"
197
+ },
198
+ {
199
+ "include": "#graphql-input-types"
200
+ }
201
+ ]
202
+ },
203
+ "graphql-schema": {
204
+ "begin": "\\s*\\b(schema)\\b",
205
+ "end": "(?<=})",
206
+ "beginCaptures": {
207
+ "1": {
208
+ "name": "keyword.schema.graphql"
209
+ }
210
+ },
211
+ "patterns": [
212
+ {
213
+ "begin": "\\s*({)",
214
+ "end": "\\s*(})",
215
+ "beginCaptures": {
216
+ "1": {
217
+ "name": "punctuation.operation.graphql"
218
+ }
219
+ },
220
+ "endCaptures": {
221
+ "1": {
222
+ "name": "punctuation.operation.graphql"
223
+ }
224
+ },
225
+ "patterns": [
226
+ {
227
+ "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)",
228
+ "end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)",
229
+ "beginCaptures": {
230
+ "1": {
231
+ "name": "variable.arguments.graphql"
232
+ }
233
+ },
234
+ "endCaptures": {
235
+ "5": {
236
+ "name": "punctuation.comma.graphql"
237
+ }
238
+ },
239
+ "patterns": [
240
+ {
241
+ "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)",
242
+ "captures": {
243
+ "1": {
244
+ "name": "support.type.graphql"
245
+ }
246
+ }
247
+ },
248
+ {
249
+ "include": "#graphql-colon"
250
+ },
251
+ {
252
+ "include": "#graphql-comment"
253
+ },
254
+ {
255
+ "include": "#graphql-skip-newlines"
256
+ }
257
+ ]
258
+ },
259
+ {
260
+ "include": "#graphql-comment"
261
+ },
262
+ {
263
+ "include": "#graphql-skip-newlines"
264
+ }
265
+ ]
266
+ },
267
+ {
268
+ "include": "#graphql-comment"
269
+ },
270
+ {
271
+ "include": "#graphql-skip-newlines"
272
+ }
273
+ ]
274
+ },
275
+ "graphql-comment": {
276
+ "comment": "need to prefix comment space with a scope else Atom's reflow cmd doesn't work",
277
+ "name": "comment.line.graphql.js",
278
+ "match": "(\\s*)(#).*",
279
+ "captures": {
280
+ "1": {
281
+ "name": "punctuation.whitespace.comment.leading.graphql"
55
282
  }
56
283
  }
57
284
  },
58
- {
59
- "include": "#arguments"
285
+ "graphql-variable-definitions": {
286
+ "begin": "\\s*(\\()",
287
+ "end": "\\s*(\\))",
288
+ "captures": {
289
+ "1": {
290
+ "name": "meta.brace.round.graphql"
291
+ }
292
+ },
293
+ "patterns": [
294
+ {
295
+ "include": "#graphql-comment"
296
+ },
297
+ {
298
+ "include": "#graphql-variable-definition"
299
+ }
300
+ ]
60
301
  },
61
- {
62
- "include": "#selections"
63
- }
64
- ],
65
- "repository": {
66
- "string": {
67
- "name": "string.quoted.double",
68
- "begin": "\"",
302
+ "graphql-variable-definition": {
303
+ "comment": "variable: type = value,.... which may be a list",
304
+ "name": "meta.variables.graphql",
305
+ "begin": "\\s*(\\$?[_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)",
306
+ "end": "(?=\\s*((\\$?[_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(}|\\))))|\\s*(,)",
69
307
  "beginCaptures": {
70
- "0": {
71
- "name": "punctuation.definition.string.begin"
308
+ "1": {
309
+ "name": "variable.graphql"
72
310
  }
73
311
  },
74
- "end": "\"",
75
312
  "endCaptures": {
76
- "0": {
77
- "name": "punctuation.definition.string.end"
313
+ "5": {
314
+ "name": "punctuation.comma.graphql"
78
315
  }
79
316
  },
80
317
  "patterns": [
81
318
  {
82
- "include": "#escapedChar"
319
+ "include": "#graphql-comment"
320
+ },
321
+ {
322
+ "include": "#graphql-colon"
323
+ },
324
+ {
325
+ "include": "#graphql-input-types"
326
+ },
327
+ {
328
+ "include": "#graphql-variable-assignment"
329
+ },
330
+ {
331
+ "include": "#graphql-skip-newlines"
83
332
  }
84
333
  ]
85
334
  },
86
- "variableDefinition": {
87
- "match": "(\\$[_A-Za-z][_0-9A-Za-z]*)\\:\\s*([_A-Za-z][_0-9A-Za-z]*)",
335
+ "graphql-input-types": {
336
+ "patterns": [
337
+ {
338
+ "include": "#graphql-scalar-type"
339
+ },
340
+ {
341
+ "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(!))?",
342
+ "captures": {
343
+ "1": {
344
+ "name": "support.type.graphql"
345
+ },
346
+ "2": {
347
+ "name": "keyword.operator.nulltype.graphql"
348
+ }
349
+ }
350
+ },
351
+ {
352
+ "name": "meta.type.list.graphql",
353
+ "begin": "\\s*(\\[)",
354
+ "end": "\\s*(\\])(?:\\s*(!))?",
355
+ "captures": {
356
+ "1": {
357
+ "name": "meta.brace.squart.graphql"
358
+ },
359
+ "2": {
360
+ "name": "keyword.operator.nulltype.graphql"
361
+ }
362
+ },
363
+ "patterns": [
364
+ {
365
+ "include": "#graphql-input-types"
366
+ },
367
+ {
368
+ "include": "#graphql-comment"
369
+ },
370
+ {
371
+ "include": "#graphql-comma"
372
+ }
373
+ ]
374
+ }
375
+ ]
376
+ },
377
+ "graphql-scalar": {
378
+ "match": "\\s*\\b(scalar)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)",
88
379
  "captures": {
89
380
  "1": {
90
- "name": "constant.other.symbol"
381
+ "name": "keyword.scalar.graphql"
91
382
  },
92
383
  "2": {
93
- "name": "support.class"
384
+ "name": "entity.scalar.graphql"
94
385
  }
95
386
  }
96
387
  },
97
- "variableUsage": {
98
- "match": "\\$[_A-Za-z][_0-9A-Za-z]*",
99
- "name": "constant.other.symbol"
100
- },
101
- "boolean": {
102
- "name": "constant.language.boolean",
103
- "match": "true|false"
104
- },
105
- "number": {
106
- "name": "constant.numeric",
107
- "match": "\\d+\\.?\\d*[eE]?[\\+\\-]?\\d*"
388
+ "graphql-scalar-type": {
389
+ "match": "\\s*\\b(Int|Float|String|Boolean|ID)\\b(?:\\s*(!))?",
390
+ "captures": {
391
+ "1": {
392
+ "name": "support.type.builtin.graphql"
393
+ },
394
+ "2": {
395
+ "name": "keyword.operator.nulltype.graphql"
396
+ }
397
+ }
108
398
  },
109
- "directive": {
110
- "name": "storage.modifier",
111
- "match": "@[_A-Za-z][_0-9A-Za-z]+"
399
+ "graphql-variable-assignment": {
400
+ "begin": "\\s(=)",
401
+ "end": "(?=.)",
402
+ "applyEndPatternLast": 1,
403
+ "beginCaptures": {
404
+ "1": {
405
+ "name": "punctuation.assignment.graphql"
406
+ }
407
+ },
408
+ "patterns": [
409
+ {
410
+ "include": "#graphql-value"
411
+ }
412
+ ]
112
413
  },
113
- "argument": {
114
- "name": "variable.parameter",
115
- "match": "[_A-Za-z][_0-9A-Za-z]*:"
414
+ "graphql-comma": {
415
+ "match": "\\s*(,)",
416
+ "captures": {
417
+ "1": {
418
+ "name": "punctuation.comma.graphql"
419
+ }
420
+ }
116
421
  },
117
- "enum": {
118
- "match": "([A-Z][A-Z_]+)",
119
- "name": "support.constant.enum"
422
+ "graphql-colon": {
423
+ "match": "\\s*(:)",
424
+ "captures": {
425
+ "1": {
426
+ "name": "punctuation.colon.graphql"
427
+ }
428
+ }
120
429
  },
121
- "fragmentSpread": {
122
- "match": "(\\.\\.\\.)\\s*([_A-Za-z][_0-9A-Za-z]*)\\s*(on\\s*)?([_A-Za-z][_0-9A-Za-z]*)?",
430
+ "graphql-union-mark": {
431
+ "match": "\\s*(\\|)",
123
432
  "captures": {
124
433
  "1": {
125
- "name": "keyword.operator"
126
- },
127
- "2": {
128
- "name": "variable.other"
129
- },
130
- "3": {
131
- "name": "keyword.operator"
132
- },
133
- "4": {
134
- "name": "support.class"
434
+ "name": "punctuation.union.graphql"
135
435
  }
136
436
  }
137
437
  },
138
- "inlineFragment": {
139
- "match": "(\\.\\.\\.)\\s*(on)\\s*([_A-Za-z][_0-9A-Za-z]*)",
438
+ "graphql-name": {
439
+ "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)",
140
440
  "captures": {
141
441
  "1": {
142
- "name": "keyword.operator"
442
+ "name": "entity.name.function.graphql"
443
+ }
444
+ }
445
+ },
446
+ "graphql-directive": {
447
+ "begin": "\\s*((@)\\s*([_A-Za-z][_0-9A-Za-z]*))",
448
+ "end": "(?=.)",
449
+ "applyEndPatternLast": 1,
450
+ "beginCaptures": {
451
+ "1": {
452
+ "name": "entity.name.function.directive.graphql"
453
+ }
454
+ },
455
+ "patterns": [
456
+ {
457
+ "include": "#graphql-arguments"
143
458
  },
144
- "2": {
145
- "name": "keyword.operator"
459
+ {
460
+ "include": "#graphql-comment"
146
461
  },
147
- "3": {
148
- "name": "support.class"
462
+ {
463
+ "include": "#graphql-skip-newlines"
149
464
  }
150
- }
465
+ ]
151
466
  },
152
- "arguments": {
153
- "name": "meta.arguments",
154
- "begin": "\\(",
467
+ "graphql-selection-set": {
468
+ "name": "meta.selectionset.graphql",
469
+ "begin": "\\s*({)",
470
+ "end": "\\s*(})",
155
471
  "beginCaptures": {
156
- "0": {
157
- "name": "meta.brace.round.graphql"
472
+ "1": {
473
+ "name": "punctuation.operation.graphql"
158
474
  }
159
475
  },
160
- "end": "\\)",
161
476
  "endCaptures": {
162
- "0": {
163
- "name": "meta.brace.round.graphql"
477
+ "1": {
478
+ "name": "punctuation.operation.graphql"
164
479
  }
165
480
  },
166
481
  "patterns": [
167
482
  {
168
- "include": "#argument"
483
+ "include": "#graphql-field"
169
484
  },
170
485
  {
171
- "include": "#string"
486
+ "include": "#graphql-fragment-spread"
172
487
  },
173
488
  {
174
- "include": "#boolean"
489
+ "include": "#graphql-inline-fragment"
175
490
  },
176
491
  {
177
- "include": "#variableDefinition"
492
+ "include": "#graphql-comma"
178
493
  },
179
494
  {
180
- "include": "#variableUsage"
495
+ "include": "#graphql-comment"
496
+ }
497
+ ]
498
+ },
499
+ "graphql-field": {
500
+ "patterns": [
501
+ {
502
+ "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)\\s*(:)",
503
+ "captures": {
504
+ "1": {
505
+ "name": "string.unquoted.alias.graphql"
506
+ },
507
+ "2": {
508
+ "name": "punctuation.colon.graphql"
509
+ }
510
+ }
181
511
  },
182
512
  {
183
- "include": "#number"
513
+ "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)",
514
+ "captures": {
515
+ "1": {
516
+ "name": "variable.graphql"
517
+ }
518
+ }
184
519
  },
185
520
  {
186
- "include": "#enum"
521
+ "include": "#graphql-arguments"
187
522
  },
188
523
  {
189
- "include": "#directive"
524
+ "include": "#graphql-directive"
190
525
  },
191
526
  {
192
- "include": "#comment"
527
+ "include": "#graphql-selection-set"
528
+ },
529
+ {
530
+ "include": "#graphql-skip-newlines"
193
531
  }
194
532
  ]
195
533
  },
196
- "selections": {
197
- "name": "meta.selections",
198
- "begin": "\\{",
199
- "beginCaptures": {
200
- "0": {
201
- "name": "meta.brace.curly.graphql"
202
- }
203
- },
204
- "end": "\\}",
205
- "endCaptures": {
206
- "0": {
207
- "name": "meta.brace.curly.graphql"
534
+ "graphql-fragment-spread": {
535
+ "begin": "\\s*(\\.\\.\\.)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)",
536
+ "end": "(?=.)",
537
+ "applyEndPatternLast": 1,
538
+ "captures": {
539
+ "1": {
540
+ "name": "keyword.operator.spread.graphql"
541
+ },
542
+ "2": {
543
+ "name": "variable.fragment.graphql"
208
544
  }
209
545
  },
210
546
  "patterns": [
211
547
  {
212
- "include": "#fieldAlias"
548
+ "include": "#graphql-comment"
213
549
  },
214
550
  {
215
- "include": "#inlineFragment"
551
+ "include": "#graphql-selection-set"
216
552
  },
217
553
  {
218
- "include": "#fragmentSpread"
554
+ "include": "#graphql-directive"
219
555
  },
220
556
  {
221
- "include": "#directive"
557
+ "include": "#graphql-skip-newlines"
558
+ }
559
+ ]
560
+ },
561
+ "graphql-inline-fragment": {
562
+ "begin": "\\s*(\\.\\.\\.)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*))?",
563
+ "end": "(?=.)",
564
+ "applyEndPatternLast": 1,
565
+ "captures": {
566
+ "1": {
567
+ "name": "keyword.operator.spread.graphql"
222
568
  },
223
- {
224
- "include": "#arguments"
569
+ "2": {
570
+ "name": "keyword.on.graphql"
225
571
  },
572
+ "3": {
573
+ "name": "support.type.graphql"
574
+ }
575
+ },
576
+ "patterns": [
226
577
  {
227
- "include": "#comment"
578
+ "include": "#graphql-comment"
228
579
  },
229
580
  {
230
- "include": "#selections"
581
+ "include": "#graphql-selection-set"
231
582
  },
232
583
  {
233
- "include": "#builtInField"
584
+ "include": "#graphql-directive"
234
585
  },
235
586
  {
236
- "include": "#enum"
587
+ "include": "#graphql-skip-newlines"
237
588
  }
238
589
  ]
239
590
  },
240
- "comment": {
241
- "name": "comment.line.number-sign.graphql",
242
- "match": "#.*$"
591
+ "graphql-arguments": {
592
+ "name": "meta.arguments.graphql",
593
+ "begin": "\\s*(\\()",
594
+ "end": "\\s*(\\))",
595
+ "beginCaptures": {
596
+ "1": {
597
+ "name": "meta.brace.round.directive.graphql"
598
+ }
599
+ },
600
+ "endCaptures": {
601
+ "1": {
602
+ "name": "meta.brace.round.directive.graphql"
603
+ }
604
+ },
605
+ "patterns": [
606
+ {
607
+ "include": "#graphql-comment"
608
+ },
609
+ {
610
+ "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))?",
611
+ "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)",
612
+ "beginCaptures": {
613
+ "1": {
614
+ "name": "variable.arguments.graphql"
615
+ },
616
+ "2": {
617
+ "name": "punctuation.colon.graphql"
618
+ }
619
+ },
620
+ "endCaptures": {
621
+ "3": {
622
+ "name": "punctuation.comma.graphql"
623
+ }
624
+ },
625
+ "patterns": [
626
+ {
627
+ "include": "#graphql-value"
628
+ },
629
+ {
630
+ "include": "#graphql-comment"
631
+ },
632
+ {
633
+ "include": "#graphql-skip-newlines"
634
+ }
635
+ ]
636
+ }
637
+ ]
243
638
  },
244
- "builtInField": {
245
- "match": "__schema|__typename|__type",
246
- "name": "keyword.other.graphql"
639
+ "graphql-variable-name": {
640
+ "match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)",
641
+ "captures": {
642
+ "1": {
643
+ "name": "variable.graphql"
644
+ }
645
+ }
247
646
  },
248
- "escapedChar": {
249
- "match": "\\\\(?:u[\\da-fA-f]{4}|.)",
250
- "name": "constant.character.escape.graphql"
647
+ "graphql-int-value": {
648
+ "match": "\\s*((-)?(0|[1-9][0-9]*))",
649
+ "captures": {
650
+ "1": {
651
+ "name": "constant.int.graphql"
652
+ }
653
+ }
251
654
  },
252
- "fieldAlias": {
253
- "match": "[_A-Za-z][_0-9A-Za-z]*:",
254
- "name": "variable.other.alias.graphql"
655
+ "graphql-float-value": {
656
+ "match": "\\s*((-)?(0|([1-9]\\d*)(\\.\\d*)?((e|E)(\\+|-)?\\d*)?))",
657
+ "captures": {
658
+ "1": {
659
+ "name": "constant.float.graphql"
660
+ }
661
+ }
255
662
  },
256
- "typeDef": {
257
- "match": "(type|interface|union|scalar|enum|input|directive|extend|schema)\\s+([_A-Za-z][_0-9A-Za-z]*)?",
663
+ "graphql-boolean-value": {
664
+ "match": "\\s*\\b(true|false)\\b",
258
665
  "captures": {
259
666
  "1": {
260
- "name": "keyword.operator"
667
+ "name": "constant.boolean.graphql"
668
+ }
669
+ }
670
+ },
671
+ "graphql-string-value": {
672
+ "contentName": "string.quoted.double.graphql",
673
+ "begin": "\\s*+((\"))",
674
+ "end": "\\s*+(?:((\"))|(\n))",
675
+ "beginCaptures": {
676
+ "1": {
677
+ "name": "string.quoted.double.graphql"
261
678
  },
262
679
  "2": {
263
- "name": "support.class"
680
+ "name": "punctuation.definition.string.begin.graphql"
264
681
  }
265
- }
682
+ },
683
+ "endCaptures": {
684
+ "1": {
685
+ "name": "string.quoted.double.graphql"
686
+ },
687
+ "2": {
688
+ "name": "punctuation.definition.string.end.graphql"
689
+ },
690
+ "3": {
691
+ "name": "invalid.illegal.newline.graphql"
692
+ }
693
+ },
694
+ "patterns": [
695
+ {
696
+ "include": "#graphql-string-content"
697
+ }
698
+ ]
699
+ },
700
+ "graphql-string-content": {
701
+ "patterns": [
702
+ {
703
+ "name": "constant.character.escape.graphql",
704
+ "match": "\\\\[/'\"\\\\nrtbf]"
705
+ },
706
+ {
707
+ "name": "constant.character.escape.graphql",
708
+ "match": "\\\\u([0-9a-fA-F]{4})"
709
+ }
710
+ ]
711
+ },
712
+ "graphql-enum": {
713
+ "name": "meta.enum.graphql",
714
+ "begin": "\\s*+\\b(enum)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)",
715
+ "end": "(?<=})",
716
+ "beginCaptures": {
717
+ "1": {
718
+ "name": "keyword.enum.graphql"
719
+ },
720
+ "2": {
721
+ "name": "support.type.enum.graphql"
722
+ }
723
+ },
724
+ "patterns": [
725
+ {
726
+ "name": "meta.type.object.graphql",
727
+ "begin": "\\s*({)",
728
+ "end": "\\s*(})",
729
+ "beginCaptures": {
730
+ "1": {
731
+ "name": "punctuation.operation.graphql"
732
+ }
733
+ },
734
+ "endCaptures": {
735
+ "1": {
736
+ "name": "punctuation.operation.graphql"
737
+ }
738
+ },
739
+ "patterns": [
740
+ {
741
+ "include": "#graphql-object-type"
742
+ },
743
+ {
744
+ "include": "#graphql-comment"
745
+ },
746
+ {
747
+ "include": "#graphql-enum-value"
748
+ }
749
+ ]
750
+ }
751
+ ]
752
+ },
753
+ "graphql-enum-value": {
754
+ "name": "constant.character.enum.graphql",
755
+ "match": "\\s*(?!=\\b(true|false|null)\\b)([_A-Za-z][_0-9A-Za-z]*)"
266
756
  },
267
- "typeDefImplements": {
268
- "match": "(implements)\\s+([_A-Za-z][_0-9A-Za-z,\\s]*)",
757
+ "graphql-value": {
758
+ "patterns": [
759
+ {
760
+ "include": "#graphql-variable-name"
761
+ },
762
+ {
763
+ "include": "#graphql-float-value"
764
+ },
765
+ {
766
+ "include": "#graphql-int-value"
767
+ },
768
+ {
769
+ "include": "#graphql-string-value"
770
+ },
771
+ {
772
+ "include": "#graphql-boolean-value"
773
+ },
774
+ {
775
+ "include": "#graphql-enum-value"
776
+ },
777
+ {
778
+ "include": "#graphql-list-value"
779
+ },
780
+ {
781
+ "include": "#graphql-object-value"
782
+ },
783
+ {
784
+ "include": "#graphql-comment"
785
+ },
786
+ {
787
+ "include": "#literal-quasi-embedded"
788
+ }
789
+ ]
790
+ },
791
+ "graphql-list-value": {
792
+ "patterns": [
793
+ {
794
+ "name": "meta.listvalues.graphql",
795
+ "begin": "\\s*+(\\[)",
796
+ "end": "\\s*(\\])",
797
+ "endCaptures": {
798
+ "1": {
799
+ "name": "meta.brace.square.graphql"
800
+ }
801
+ },
802
+ "beginCaptures": {
803
+ "1": {
804
+ "name": "meta.brace.square.graphql"
805
+ }
806
+ },
807
+ "patterns": [
808
+ {
809
+ "include": "#graphql-value"
810
+ }
811
+ ]
812
+ }
813
+ ]
814
+ },
815
+ "graphql-object-value": {
816
+ "patterns": [
817
+ {
818
+ "name": "meta.objectvalues.graphql",
819
+ "begin": "\\s*+({)",
820
+ "end": "\\s*(})",
821
+ "endCaptures": {
822
+ "1": {
823
+ "name": "meta.brace.curly.graphql"
824
+ }
825
+ },
826
+ "beginCaptures": {
827
+ "1": {
828
+ "name": "meta.brace.curly.graphql"
829
+ }
830
+ },
831
+ "patterns": [
832
+ {
833
+ "include": "#graphql-object-field"
834
+ },
835
+ {
836
+ "include": "#graphql-value"
837
+ }
838
+ ]
839
+ }
840
+ ]
841
+ },
842
+ "graphql-object-field": {
843
+ "match": "\\s*(([_A-Za-z][_0-9A-Za-z]*))\\s*(:)",
269
844
  "captures": {
270
845
  "1": {
271
- "name": "keyword.operator"
846
+ "name": "constant.object.key.graphql"
272
847
  },
273
848
  "2": {
274
- "name": "support.class"
849
+ "name": "string.unquoted.graphql"
850
+ },
851
+ "3": {
852
+ "name": "punctuation.graphql"
275
853
  }
276
854
  }
277
855
  },
278
- "unionOptions": {
279
- "match": "(=|\\||on)\\s+([_A-Za-z][_0-9A-Za-z]*)",
856
+ "graphql-union": {
857
+ "begin": "\\s*\\b(union)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)",
858
+ "end": "(?=.)",
859
+ "applyEndPatternLast": 1,
280
860
  "captures": {
281
861
  "1": {
282
- "name": "keyword.operator"
862
+ "name": "keyword.union.graphql"
283
863
  },
284
864
  "2": {
285
- "name": "support.class"
865
+ "name": "support.type.graphql"
286
866
  }
287
- }
867
+ },
868
+ "patterns": [
869
+ {
870
+ "begin": "\\s*(=)\\s*([_A-Za-z][_0-9A-Za-z]*)",
871
+ "end": "(?=.)",
872
+ "applyEndPatternLast": 1,
873
+ "captures": {
874
+ "1": {
875
+ "name": "punctuation.assignment.graphql"
876
+ },
877
+ "2": {
878
+ "name": "support.type.graphql"
879
+ }
880
+ },
881
+ "patterns": [
882
+ {
883
+ "include": "#graphql-skip-newlines"
884
+ },
885
+ {
886
+ "include": "#graphql-comment"
887
+ },
888
+ {
889
+ "match": "\\s*(\\|)\\s*([_A-Za-z][_0-9A-Za-z]*)",
890
+ "captures": {
891
+ "1": {
892
+ "name": "punctuation.or.graphql"
893
+ },
894
+ "2": {
895
+ "name": "support.type.graphql"
896
+ }
897
+ }
898
+ }
899
+ ]
900
+ },
901
+ {
902
+ "include": "#graphql-skip-newlines"
903
+ },
904
+ {
905
+ "include": "#graphql-comment"
906
+ },
907
+ {
908
+ "include": "#literal-quasi-embedded"
909
+ }
910
+ ]
911
+ },
912
+ "graphql-skip-newlines": {
913
+ "match": "\\s*\n"
288
914
  }
289
915
  }
290
916
  }