|
13 | 13 | "repository": {
|
14 | 14 | "graphql": {
|
15 | 15 | "patterns": [
|
| 16 | + { "include": "#graphql-comment" }, |
| 17 | + { "include": "#graphql-description" }, |
16 | 18 | { "include": "#graphql-fragment-definition" },
|
17 | 19 | { "include": "#graphql-type-interface" },
|
18 | 20 | { "include": "#graphql-enum" },
|
19 | 21 | { "include": "#graphql-scalar" },
|
20 | 22 | { "include": "#graphql-union" },
|
21 | 23 | { "include": "#graphql-schema" },
|
22 | 24 | { "include": "#graphql-operation-def" },
|
23 |
| - { "include": "#graphql-comment" }, |
24 | 25 | { "include": "#literal-quasi-embedded" }
|
25 | 26 | ]
|
26 | 27 | },
|
|
45 | 46 | },
|
46 | 47 | "patterns": [
|
47 | 48 | { "include": "#graphql-comment" },
|
| 49 | + { "include": "#graphql-description" }, |
48 | 50 | { "include": "#graphql-selection-set" },
|
49 | 51 | { "include": "#graphql-directive" },
|
50 | 52 | { "include": "#graphql-skip-newlines" },
|
|
85 | 87 | { "include": "#graphql-comma" }
|
86 | 88 | ]
|
87 | 89 | },
|
88 |
| - { "include": "#graphql-directive" }, |
89 | 90 | { "include": "#graphql-comment" },
|
| 91 | + { "include": "#graphql-description" }, |
| 92 | + { "include": "#graphql-directive" }, |
90 | 93 | { "include": "#graphql-type-object" },
|
91 | 94 | { "include": "#literal-quasi-embedded" }
|
92 | 95 | ]
|
|
102 | 105 | "1": { "name": "punctuation.operation.graphql"}
|
103 | 106 | },
|
104 | 107 | "patterns": [
|
105 |
| - { "include": "#graphql-object-type" }, |
106 |
| - |
107 | 108 | { "include": "#graphql-comment" },
|
| 109 | + { "include": "#graphql-description" }, |
| 110 | + { "include": "#graphql-object-type" }, |
108 | 111 | { "include": "#graphql-type-definition" },
|
109 | 112 | { "include": "#literal-quasi-embedded" }
|
110 | 113 | ]
|
|
121 | 124 | },
|
122 | 125 | "patterns": [
|
123 | 126 | { "include": "#graphql-comment" },
|
| 127 | + { "include": "#graphql-description" }, |
124 | 128 | { "include": "#graphql-variable-definitions" },
|
125 | 129 | { "include": "#graphql-type-object" },
|
126 | 130 | { "include": "#graphql-colon"},
|
|
161 | 165 | "1": { "name": "support.type.graphql" }
|
162 | 166 | }
|
163 | 167 | },
|
164 |
| - { "include": "#graphql-colon" }, |
165 | 168 | { "include": "#graphql-comment" },
|
| 169 | + { "include": "#graphql-description" }, |
| 170 | + { "include": "#graphql-colon" }, |
166 | 171 | { "include": "#graphql-skip-newlines" }
|
167 | 172 | ]
|
168 | 173 | },
|
169 | 174 | { "include": "#graphql-comment" },
|
| 175 | + { "include": "#graphql-description" }, |
170 | 176 | { "include": "#graphql-skip-newlines" }
|
171 | 177 | ]
|
172 | 178 | },
|
173 | 179 | { "include": "#graphql-comment" },
|
| 180 | + { "include": "#graphql-description" }, |
174 | 181 | { "include": "#graphql-skip-newlines" }
|
175 | 182 | ]
|
176 | 183 | },
|
177 | 184 | "graphql-comment": {
|
178 | 185 | "comment": "need to prefix comment space with a scope else Atom's reflow cmd doesn't work",
|
179 |
| - "name": "comment.line.graphql.js", |
180 |
| - "match": "(\\s*)(#).*", |
181 |
| - "captures": { |
182 |
| - "1": { "name": "punctuation.whitespace.comment.leading.graphql" } |
183 |
| - } |
| 186 | + "name": "comment.line.graphql", |
| 187 | + "match": "\\s*#.*" |
| 188 | + }, |
| 189 | + "graphql-description": { |
| 190 | + "comment": "In new graphql spec 0.12.0, the description has to enclosed in two lines of triple quotes", |
| 191 | + "name": "graphql.description", |
| 192 | + "begin": "^\\s*(\"\"\")$", |
| 193 | + "beginCaptures": { |
| 194 | + "1": { "name": "comment.quoted.double.graphql.begin" } |
| 195 | + }, |
| 196 | + "end": "^\\s*(\"\"\")$", |
| 197 | + "endCaptures": { |
| 198 | + "1": { "name": "comment.quoted.double.graphql.end" } |
| 199 | + }, |
| 200 | + "patterns": [ |
| 201 | + { |
| 202 | + "name": "comment.line.graphql", |
| 203 | + "match": "^\\s*.*$" |
| 204 | + } |
| 205 | + ] |
184 | 206 | },
|
185 | 207 | "graphql-variable-definitions": {
|
186 | 208 | "begin": "\\s*(\\()",
|
|
190 | 212 | },
|
191 | 213 | "patterns": [
|
192 | 214 | { "include": "#graphql-comment" },
|
| 215 | + { "include": "#graphql-description" }, |
193 | 216 | { "include": "#graphql-variable-definition"},
|
194 | 217 | { "include": "#literal-quasi-embedded" }
|
195 | 218 | ]
|
|
207 | 230 | },
|
208 | 231 | "patterns": [
|
209 | 232 | { "include": "#graphql-comment" },
|
| 233 | + { "include": "#graphql-description" }, |
210 | 234 | { "include": "#graphql-colon" },
|
211 | 235 | { "include": "#graphql-input-types"},
|
212 | 236 | { "include": "#graphql-variable-assignment"},
|
|
233 | 257 | "2": { "name": "keyword.operator.nulltype.graphql" }
|
234 | 258 | },
|
235 | 259 | "patterns": [
|
236 |
| - { "include": "#graphql-input-types" }, |
237 | 260 | { "include": "#graphql-comment" },
|
| 261 | + { "include": "#graphql-description" }, |
| 262 | + { "include": "#graphql-input-types" }, |
238 | 263 | { "include": "#graphql-comma" },
|
239 | 264 | { "include": "#literal-quasi-embedded" }
|
240 | 265 | ]
|
|
298 | 323 | "1": { "name": "entity.name.function.directive.graphql" }
|
299 | 324 | },
|
300 | 325 | "patterns": [
|
301 |
| - { "include": "#graphql-arguments"}, |
302 | 326 | { "include": "#graphql-comment" },
|
| 327 | + { "include": "#graphql-description" }, |
| 328 | + { "include": "#graphql-arguments"}, |
303 | 329 | { "include": "#literal-quasi-embedded" },
|
304 | 330 | { "include": "#graphql-skip-newlines" }
|
305 | 331 | ]
|
|
315 | 341 | "1": { "name": "punctuation.operation.graphql"}
|
316 | 342 | },
|
317 | 343 | "patterns": [
|
| 344 | + { "include": "#graphql-comment" }, |
| 345 | + { "include": "#graphql-description" }, |
318 | 346 | { "include": "#graphql-field" },
|
319 | 347 | { "include": "#graphql-fragment-spread" },
|
320 | 348 | { "include": "#graphql-inline-fragment" },
|
321 | 349 | { "include": "#graphql-comma" },
|
322 |
| - { "include": "#graphql-comment" }, |
323 | 350 | { "include": "#native-interpolation" },
|
324 | 351 | { "include": "#literal-quasi-embedded" }
|
325 | 352 | ]
|
|
356 | 383 | },
|
357 | 384 | "patterns": [
|
358 | 385 | { "include": "#graphql-comment" },
|
| 386 | + { "include": "#graphql-description" }, |
359 | 387 | { "include": "#graphql-selection-set" },
|
360 | 388 | { "include": "#graphql-directive" },
|
361 | 389 | { "include": "#literal-quasi-embedded" },
|
|
373 | 401 | },
|
374 | 402 | "patterns": [
|
375 | 403 | { "include": "#graphql-comment" },
|
| 404 | + { "include": "#graphql-description" }, |
376 | 405 | { "include": "#graphql-selection-set" },
|
377 | 406 | { "include": "#graphql-directive" },
|
378 | 407 | { "include": "#graphql-skip-newlines" },
|
|
391 | 420 | },
|
392 | 421 | "patterns": [
|
393 | 422 | { "include": "#graphql-comment" },
|
| 423 | + { "include": "#graphql-description" }, |
394 | 424 | {
|
395 | 425 | "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))",
|
396 | 426 | "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)",
|
|
402 | 432 | "3": { "name": "punctuation.comma.graphql" }
|
403 | 433 | },
|
404 | 434 | "patterns": [
|
405 |
| - { "include": "#graphql-value" }, |
406 | 435 | { "include": "#graphql-comment" },
|
| 436 | + { "include": "#graphql-description" }, |
| 437 | + { "include": "#graphql-value" }, |
407 | 438 | { "include": "#graphql-skip-newlines" }
|
408 | 439 | ]
|
409 | 440 | },
|
|
485 | 516 | { "include": "#graphql-object-type" },
|
486 | 517 |
|
487 | 518 | { "include": "#graphql-comment" },
|
| 519 | + { "include": "#graphql-description" }, |
488 | 520 | { "include": "#graphql-enum-value" },
|
489 | 521 | { "include": "#literal-quasi-embedded" }
|
490 | 522 | ]
|
|
497 | 529 | },
|
498 | 530 | "graphql-value":{
|
499 | 531 | "patterns": [
|
| 532 | + { "include": "#graphql-comment" }, |
| 533 | + { "include": "#graphql-description" }, |
500 | 534 | { "include": "#graphql-variable-name" },
|
501 | 535 | { "include": "#graphql-float-value" },
|
502 | 536 | { "include": "#graphql-string-value" },
|
|
505 | 539 | { "include": "#graphql-enum-value" },
|
506 | 540 | { "include": "#graphql-list-value" },
|
507 | 541 | { "include": "#graphql-object-value" },
|
508 |
| - { "include": "#graphql-comment" }, |
509 | 542 | { "include": "#literal-quasi-embedded" }
|
510 | 543 | ]
|
511 | 544 | },
|
|
572 | 605 | "2": { "name": "support.type.graphql" }
|
573 | 606 | },
|
574 | 607 | "patterns": [
|
575 |
| - { "include": "#graphql-skip-newlines" }, |
576 | 608 | { "include": "#graphql-comment" },
|
| 609 | + { "include": "#graphql-description" }, |
| 610 | + { "include": "#graphql-skip-newlines" }, |
577 | 611 | { "include": "#literal-quasi-embedded" },
|
578 | 612 | {
|
579 | 613 | "match": "\\s*(\\|)\\s*([_A-Za-z][_0-9A-Za-z]*)",
|
|
584 | 618 | }
|
585 | 619 | ]
|
586 | 620 | },
|
587 |
| - { "include": "#graphql-skip-newlines" }, |
588 | 621 | { "include": "#graphql-comment" },
|
| 622 | + { "include": "#graphql-description" }, |
| 623 | + { "include": "#graphql-skip-newlines" }, |
589 | 624 | { "include": "#literal-quasi-embedded" }
|
590 | 625 | ]
|
591 | 626 | },
|
|
0 commit comments