| 1 |
{ |
| 2 |
"name": "graphql", |
| 3 |
"scopeName": "source.graphql", |
| 4 |
"fileTypes": ["graphql", "graphqls", "gql", "graphcool"], |
| 5 |
"patterns": [ |
| 6 |
{ |
| 7 |
"include": "#graphql" |
| 8 |
} |
| 9 |
], |
| 10 |
"repository": { |
| 11 |
"graphql": { |
| 12 |
"patterns": [ |
| 13 |
{ |
| 14 |
"include": "#graphql-comment" |
| 15 |
}, |
| 16 |
{ |
| 17 |
"include": "#graphql-description-docstring" |
| 18 |
}, |
| 19 |
{ |
| 20 |
"include": "#graphql-description-singleline" |
| 21 |
}, |
| 22 |
{ |
| 23 |
"include": "#graphql-fragment-definition" |
| 24 |
}, |
| 25 |
{ |
| 26 |
"include": "#graphql-directive-definition" |
| 27 |
}, |
| 28 |
{ |
| 29 |
"include": "#graphql-type-interface" |
| 30 |
}, |
| 31 |
{ |
| 32 |
"include": "#graphql-enum" |
| 33 |
}, |
| 34 |
{ |
| 35 |
"include": "#graphql-scalar" |
| 36 |
}, |
| 37 |
{ |
| 38 |
"include": "#graphql-union" |
| 39 |
}, |
| 40 |
{ |
| 41 |
"include": "#graphql-schema" |
| 42 |
}, |
| 43 |
{ |
| 44 |
"include": "#graphql-operation-def" |
| 45 |
}, |
| 46 |
{ |
| 47 |
"include": "#literal-quasi-embedded" |
| 48 |
} |
| 49 |
] |
| 50 |
}, |
| 51 |
"graphql-operation-def": { |
| 52 |
"patterns": [ |
| 53 |
{ |
| 54 |
"include": "#graphql-query-mutation" |
| 55 |
}, |
| 56 |
{ |
| 57 |
"include": "#graphql-name" |
| 58 |
}, |
| 59 |
{ |
| 60 |
"include": "#graphql-variable-definitions" |
| 61 |
}, |
| 62 |
{ |
| 63 |
"include": "#graphql-directive" |
| 64 |
}, |
| 65 |
{ |
| 66 |
"include": "#graphql-selection-set" |
| 67 |
} |
| 68 |
] |
| 69 |
}, |
| 70 |
"graphql-fragment-definition": { |
| 71 |
"name": "meta.fragment.graphql", |
| 72 |
"begin": "\\s*(?:(\\bfragment\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)?\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)))", |
| 73 |
"end": "(?<=})", |
| 74 |
"captures": { |
| 75 |
"1": { |
| 76 |
"name": "keyword.fragment.graphql" |
| 77 |
}, |
| 78 |
"2": { |
| 79 |
"name": "entity.name.fragment.graphql" |
| 80 |
}, |
| 81 |
"3": { |
| 82 |
"name": "keyword.on.graphql" |
| 83 |
}, |
| 84 |
"4": { |
| 85 |
"name": "support.type.graphql" |
| 86 |
} |
| 87 |
}, |
| 88 |
"patterns": [ |
| 89 |
{ |
| 90 |
"include": "#graphql-comment" |
| 91 |
}, |
| 92 |
{ |
| 93 |
"include": "#graphql-description-docstring" |
| 94 |
}, |
| 95 |
{ |
| 96 |
"include": "#graphql-description-singleline" |
| 97 |
}, |
| 98 |
{ |
| 99 |
"include": "#graphql-selection-set" |
| 100 |
}, |
| 101 |
{ |
| 102 |
"include": "#graphql-directive" |
| 103 |
}, |
| 104 |
{ |
| 105 |
"include": "#graphql-skip-newlines" |
| 106 |
}, |
| 107 |
{ |
| 108 |
"include": "#literal-quasi-embedded" |
| 109 |
} |
| 110 |
] |
| 111 |
}, |
| 112 |
"graphql-query-mutation": { |
| 113 |
"match": "\\s*\\b(query|mutation)\\b", |
| 114 |
"captures": { |
| 115 |
"1": { |
| 116 |
"name": "keyword.operation.graphql" |
| 117 |
} |
| 118 |
} |
| 119 |
}, |
| 120 |
"graphql-type-interface": { |
| 121 |
"name": "meta.type.interface.graphql", |
| 122 |
"begin": "\\s*\\b(?:(extends?)?\\b\\s*\\b(type)|(interface)|(input))\\b\\s*([_A-Za-z][_0-9A-Za-z]*)?", |
| 123 |
"end": "(?=.)", |
| 124 |
"applyEndPatternLast": 1, |
| 125 |
"captures": { |
| 126 |
"1": { |
| 127 |
"name": "keyword.type.graphql" |
| 128 |
}, |
| 129 |
"2": { |
| 130 |
"name": "keyword.type.graphql" |
| 131 |
}, |
| 132 |
"3": { |
| 133 |
"name": "keyword.interface.graphql" |
| 134 |
}, |
| 135 |
"4": { |
| 136 |
"name": "keyword.input.graphql" |
| 137 |
}, |
| 138 |
"5": { |
| 139 |
"name": "support.type.graphql" |
| 140 |
} |
| 141 |
}, |
| 142 |
"patterns": [ |
| 143 |
{ |
| 144 |
"begin": "\\s*\\b(implements)\\b\\s*", |
| 145 |
"end": "\\s*(?={)", |
| 146 |
"beginCaptures": { |
| 147 |
"1": { |
| 148 |
"name": "keyword.implements.graphql" |
| 149 |
} |
| 150 |
}, |
| 151 |
"patterns": [ |
| 152 |
{ |
| 153 |
"match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 154 |
"captures": { |
| 155 |
"1": { |
| 156 |
"name": "support.type.graphql" |
| 157 |
} |
| 158 |
} |
| 159 |
}, |
| 160 |
{ |
| 161 |
"include": "#graphql-comment" |
| 162 |
}, |
| 163 |
{ |
| 164 |
"include": "#graphql-description-docstring" |
| 165 |
}, |
| 166 |
{ |
| 167 |
"include": "#graphql-description-singleline" |
| 168 |
}, |
| 169 |
{ |
| 170 |
"include": "#graphql-directive" |
| 171 |
}, |
| 172 |
{ |
| 173 |
"include": "#graphql-ampersand" |
| 174 |
}, |
| 175 |
{ |
| 176 |
"include": "#graphql-comma" |
| 177 |
} |
| 178 |
] |
| 179 |
}, |
| 180 |
{ |
| 181 |
"include": "#graphql-comment" |
| 182 |
}, |
| 183 |
{ |
| 184 |
"include": "#graphql-description-docstring" |
| 185 |
}, |
| 186 |
{ |
| 187 |
"include": "#graphql-description-singleline" |
| 188 |
}, |
| 189 |
{ |
| 190 |
"include": "#graphql-directive" |
| 191 |
}, |
| 192 |
{ |
| 193 |
"include": "#graphql-type-object" |
| 194 |
}, |
| 195 |
{ |
| 196 |
"include": "#literal-quasi-embedded" |
| 197 |
}, |
| 198 |
{ |
| 199 |
"include": "#graphql-ignore-spaces" |
| 200 |
} |
| 201 |
] |
| 202 |
}, |
| 203 |
"graphql-ignore-spaces": { |
| 204 |
"match": "\\s*" |
| 205 |
}, |
| 206 |
"graphql-type-object": { |
| 207 |
"name": "meta.type.object.graphql", |
| 208 |
"begin": "\\s*({)", |
| 209 |
"end": "\\s*(})", |
| 210 |
"beginCaptures": { |
| 211 |
"1": { |
| 212 |
"name": "punctuation.operation.graphql" |
| 213 |
} |
| 214 |
}, |
| 215 |
"endCaptures": { |
| 216 |
"1": { |
| 217 |
"name": "punctuation.operation.graphql" |
| 218 |
} |
| 219 |
}, |
| 220 |
"patterns": [ |
| 221 |
{ |
| 222 |
"include": "#graphql-comment" |
| 223 |
}, |
| 224 |
{ |
| 225 |
"include": "#graphql-description-docstring" |
| 226 |
}, |
| 227 |
{ |
| 228 |
"include": "#graphql-description-singleline" |
| 229 |
}, |
| 230 |
{ |
| 231 |
"include": "#graphql-object-type" |
| 232 |
}, |
| 233 |
{ |
| 234 |
"include": "#graphql-type-definition" |
| 235 |
}, |
| 236 |
{ |
| 237 |
"include": "#literal-quasi-embedded" |
| 238 |
} |
| 239 |
] |
| 240 |
}, |
| 241 |
"graphql-type-definition": { |
| 242 |
"comment": "key (optionalArgs): Type", |
| 243 |
"begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", |
| 244 |
"end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)", |
| 245 |
"beginCaptures": { |
| 246 |
"1": { |
| 247 |
"name": "variable.graphql" |
| 248 |
} |
| 249 |
}, |
| 250 |
"endCaptures": { |
| 251 |
"5": { |
| 252 |
"name": "punctuation.comma.graphql" |
| 253 |
} |
| 254 |
}, |
| 255 |
"patterns": [ |
| 256 |
{ |
| 257 |
"include": "#graphql-comment" |
| 258 |
}, |
| 259 |
{ |
| 260 |
"include": "#graphql-description-docstring" |
| 261 |
}, |
| 262 |
{ |
| 263 |
"include": "#graphql-description-singleline" |
| 264 |
}, |
| 265 |
{ |
| 266 |
"include": "#graphql-directive" |
| 267 |
}, |
| 268 |
{ |
| 269 |
"include": "#graphql-variable-definitions" |
| 270 |
}, |
| 271 |
{ |
| 272 |
"include": "#graphql-type-object" |
| 273 |
}, |
| 274 |
{ |
| 275 |
"include": "#graphql-colon" |
| 276 |
}, |
| 277 |
{ |
| 278 |
"include": "#graphql-input-types" |
| 279 |
}, |
| 280 |
{ |
| 281 |
"include": "#literal-quasi-embedded" |
| 282 |
} |
| 283 |
] |
| 284 |
}, |
| 285 |
"graphql-schema": { |
| 286 |
"begin": "\\s*\\b(schema)\\b", |
| 287 |
"end": "(?<=})", |
| 288 |
"beginCaptures": { |
| 289 |
"1": { |
| 290 |
"name": "keyword.schema.graphql" |
| 291 |
} |
| 292 |
}, |
| 293 |
"patterns": [ |
| 294 |
{ |
| 295 |
"begin": "\\s*({)", |
| 296 |
"end": "\\s*(})", |
| 297 |
"beginCaptures": { |
| 298 |
"1": { |
| 299 |
"name": "punctuation.operation.graphql" |
| 300 |
} |
| 301 |
}, |
| 302 |
"endCaptures": { |
| 303 |
"1": { |
| 304 |
"name": "punctuation.operation.graphql" |
| 305 |
} |
| 306 |
}, |
| 307 |
"patterns": [ |
| 308 |
{ |
| 309 |
"begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", |
| 310 |
"end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)", |
| 311 |
"beginCaptures": { |
| 312 |
"1": { |
| 313 |
"name": "variable.arguments.graphql" |
| 314 |
} |
| 315 |
}, |
| 316 |
"endCaptures": { |
| 317 |
"5": { |
| 318 |
"name": "punctuation.comma.graphql" |
| 319 |
} |
| 320 |
}, |
| 321 |
"patterns": [ |
| 322 |
{ |
| 323 |
"match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 324 |
"captures": { |
| 325 |
"1": { |
| 326 |
"name": "support.type.graphql" |
| 327 |
} |
| 328 |
} |
| 329 |
}, |
| 330 |
{ |
| 331 |
"include": "#graphql-comment" |
| 332 |
}, |
| 333 |
{ |
| 334 |
"include": "#graphql-description-docstring" |
| 335 |
}, |
| 336 |
{ |
| 337 |
"include": "#graphql-description-singleline" |
| 338 |
}, |
| 339 |
{ |
| 340 |
"include": "#graphql-colon" |
| 341 |
}, |
| 342 |
{ |
| 343 |
"include": "#graphql-skip-newlines" |
| 344 |
} |
| 345 |
] |
| 346 |
}, |
| 347 |
{ |
| 348 |
"include": "#graphql-comment" |
| 349 |
}, |
| 350 |
{ |
| 351 |
"include": "#graphql-description-docstring" |
| 352 |
}, |
| 353 |
{ |
| 354 |
"include": "#graphql-description-singleline" |
| 355 |
}, |
| 356 |
{ |
| 357 |
"include": "#graphql-skip-newlines" |
| 358 |
} |
| 359 |
] |
| 360 |
}, |
| 361 |
{ |
| 362 |
"include": "#graphql-comment" |
| 363 |
}, |
| 364 |
{ |
| 365 |
"include": "#graphql-description-docstring" |
| 366 |
}, |
| 367 |
{ |
| 368 |
"include": "#graphql-description-singleline" |
| 369 |
}, |
| 370 |
{ |
| 371 |
"include": "#graphql-directive" |
| 372 |
}, |
| 373 |
{ |
| 374 |
"include": "#graphql-skip-newlines" |
| 375 |
} |
| 376 |
] |
| 377 |
}, |
| 378 |
"graphql-comment": { |
| 379 |
"patterns": [ |
| 380 |
{ |
| 381 |
"comment": "need to prefix comment space with a scope else Atom's reflow cmd doesn't work", |
| 382 |
"name": "comment.line.graphql.js", |
| 383 |
"match": "(\\s*)(#).*", |
| 384 |
"captures": { |
| 385 |
"1": { |
| 386 |
"name": "punctuation.whitespace.comment.leading.graphql" |
| 387 |
} |
| 388 |
} |
| 389 |
}, |
| 390 |
{ |
| 391 |
"name": "comment.line.graphql.js", |
| 392 |
"begin": "(\"\"\")", |
| 393 |
"end": "(\"\"\")", |
| 394 |
"beginCaptures": { |
| 395 |
"1": { |
| 396 |
"name": "punctuation.whitespace.comment.leading.graphql" |
| 397 |
} |
| 398 |
} |
| 399 |
}, |
| 400 |
{ |
| 401 |
"name": "comment.line.graphql.js", |
| 402 |
"begin": "(\")", |
| 403 |
"end": "(\")", |
| 404 |
"beginCaptures": { |
| 405 |
"1": { |
| 406 |
"name": "punctuation.whitespace.comment.leading.graphql" |
| 407 |
} |
| 408 |
} |
| 409 |
} |
| 410 |
] |
| 411 |
}, |
| 412 |
"graphql-description-singleline": { |
| 413 |
"name": "comment.line.number-sign.graphql", |
| 414 |
"match": "#(?=([^\"]*\"[^\"]*\")*[^\"]*$).*$" |
| 415 |
}, |
| 416 |
"graphql-description-docstring": { |
| 417 |
"name": "comment.block.graphql", |
| 418 |
"begin": "\"\"\"", |
| 419 |
"end": "\"\"\"" |
| 420 |
}, |
| 421 |
"graphql-variable-definitions": { |
| 422 |
"begin": "\\s*(\\()", |
| 423 |
"end": "\\s*(\\))", |
| 424 |
"captures": { |
| 425 |
"1": { |
| 426 |
"name": "meta.brace.round.graphql" |
| 427 |
} |
| 428 |
}, |
| 429 |
"patterns": [ |
| 430 |
{ |
| 431 |
"include": "#graphql-comment" |
| 432 |
}, |
| 433 |
{ |
| 434 |
"include": "#graphql-description-docstring" |
| 435 |
}, |
| 436 |
{ |
| 437 |
"include": "#graphql-description-singleline" |
| 438 |
}, |
| 439 |
{ |
| 440 |
"include": "#graphql-variable-definition" |
| 441 |
}, |
| 442 |
{ |
| 443 |
"include": "#literal-quasi-embedded" |
| 444 |
} |
| 445 |
] |
| 446 |
}, |
| 447 |
"graphql-variable-definition": { |
| 448 |
"comment": "variable: type = value,.... which may be a list", |
| 449 |
"name": "meta.variables.graphql", |
| 450 |
"begin": "\\s*(\\$?[_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", |
| 451 |
"end": "(?=\\s*((\\$?[_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(}|\\))))|\\s*(,)", |
| 452 |
"beginCaptures": { |
| 453 |
"1": { |
| 454 |
"name": "variable.parameter.graphql" |
| 455 |
} |
| 456 |
}, |
| 457 |
"endCaptures": { |
| 458 |
"5": { |
| 459 |
"name": "punctuation.comma.graphql" |
| 460 |
} |
| 461 |
}, |
| 462 |
"patterns": [ |
| 463 |
{ |
| 464 |
"include": "#graphql-comment" |
| 465 |
}, |
| 466 |
{ |
| 467 |
"include": "#graphql-description-docstring" |
| 468 |
}, |
| 469 |
{ |
| 470 |
"include": "#graphql-description-singleline" |
| 471 |
}, |
| 472 |
{ |
| 473 |
"include": "#graphql-directive" |
| 474 |
}, |
| 475 |
{ |
| 476 |
"include": "#graphql-colon" |
| 477 |
}, |
| 478 |
{ |
| 479 |
"include": "#graphql-input-types" |
| 480 |
}, |
| 481 |
{ |
| 482 |
"include": "#graphql-variable-assignment" |
| 483 |
}, |
| 484 |
{ |
| 485 |
"include": "#literal-quasi-embedded" |
| 486 |
}, |
| 487 |
{ |
| 488 |
"include": "#graphql-skip-newlines" |
| 489 |
} |
| 490 |
] |
| 491 |
}, |
| 492 |
"graphql-input-types": { |
| 493 |
"patterns": [ |
| 494 |
{ |
| 495 |
"include": "#graphql-scalar-type" |
| 496 |
}, |
| 497 |
{ |
| 498 |
"match": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(!))?", |
| 499 |
"captures": { |
| 500 |
"1": { |
| 501 |
"name": "support.type.graphql" |
| 502 |
}, |
| 503 |
"2": { |
| 504 |
"name": "keyword.operator.nulltype.graphql" |
| 505 |
} |
| 506 |
} |
| 507 |
}, |
| 508 |
{ |
| 509 |
"name": "meta.type.list.graphql", |
| 510 |
"begin": "\\s*(\\[)", |
| 511 |
"end": "\\s*(\\])(?:\\s*(!))?", |
| 512 |
"captures": { |
| 513 |
"1": { |
| 514 |
"name": "meta.brace.square.graphql" |
| 515 |
}, |
| 516 |
"2": { |
| 517 |
"name": "keyword.operator.nulltype.graphql" |
| 518 |
} |
| 519 |
}, |
| 520 |
"patterns": [ |
| 521 |
{ |
| 522 |
"include": "#graphql-comment" |
| 523 |
}, |
| 524 |
{ |
| 525 |
"include": "#graphql-description-docstring" |
| 526 |
}, |
| 527 |
{ |
| 528 |
"include": "#graphql-description-singleline" |
| 529 |
}, |
| 530 |
{ |
| 531 |
"include": "#graphql-input-types" |
| 532 |
}, |
| 533 |
{ |
| 534 |
"include": "#graphql-comma" |
| 535 |
}, |
| 536 |
{ |
| 537 |
"include": "#literal-quasi-embedded" |
| 538 |
} |
| 539 |
] |
| 540 |
} |
| 541 |
] |
| 542 |
}, |
| 543 |
"graphql-scalar": { |
| 544 |
"match": "\\s*\\b(scalar)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 545 |
"captures": { |
| 546 |
"1": { |
| 547 |
"name": "keyword.scalar.graphql" |
| 548 |
}, |
| 549 |
"2": { |
| 550 |
"name": "entity.scalar.graphql" |
| 551 |
} |
| 552 |
} |
| 553 |
}, |
| 554 |
"graphql-scalar-type": { |
| 555 |
"match": "\\s*\\b(Int|Float|String|Boolean|ID)\\b(?:\\s*(!))?", |
| 556 |
"captures": { |
| 557 |
"1": { |
| 558 |
"name": "support.type.builtin.graphql" |
| 559 |
}, |
| 560 |
"2": { |
| 561 |
"name": "keyword.operator.nulltype.graphql" |
| 562 |
} |
| 563 |
} |
| 564 |
}, |
| 565 |
"graphql-variable-assignment": { |
| 566 |
"begin": "\\s(=)", |
| 567 |
"end": "(?=[\n,)])", |
| 568 |
"applyEndPatternLast": 1, |
| 569 |
"beginCaptures": { |
| 570 |
"1": { |
| 571 |
"name": "punctuation.assignment.graphql" |
| 572 |
} |
| 573 |
}, |
| 574 |
"patterns": [ |
| 575 |
{ |
| 576 |
"include": "#graphql-value" |
| 577 |
} |
| 578 |
] |
| 579 |
}, |
| 580 |
"graphql-comma": { |
| 581 |
"match": "\\s*(,)", |
| 582 |
"captures": { |
| 583 |
"1": { |
| 584 |
"name": "punctuation.comma.graphql" |
| 585 |
} |
| 586 |
} |
| 587 |
}, |
| 588 |
"graphql-ampersand": { |
| 589 |
"match": "\\s*(&)", |
| 590 |
"captures": { |
| 591 |
"1": { |
| 592 |
"name": "keyword.operator.logical.graphql" |
| 593 |
} |
| 594 |
} |
| 595 |
}, |
| 596 |
"graphql-colon": { |
| 597 |
"match": "\\s*(:)", |
| 598 |
"captures": { |
| 599 |
"1": { |
| 600 |
"name": "punctuation.colon.graphql" |
| 601 |
} |
| 602 |
} |
| 603 |
}, |
| 604 |
"graphql-union-mark": { |
| 605 |
"match": "\\s*(\\|)", |
| 606 |
"captures": { |
| 607 |
"1": { |
| 608 |
"name": "punctuation.union.graphql" |
| 609 |
} |
| 610 |
} |
| 611 |
}, |
| 612 |
"graphql-name": { |
| 613 |
"match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 614 |
"captures": { |
| 615 |
"1": { |
| 616 |
"name": "entity.name.function.graphql" |
| 617 |
} |
| 618 |
} |
| 619 |
}, |
| 620 |
"graphql-directive": { |
| 621 |
"begin": "\\s*((@)\\s*([_A-Za-z][_0-9A-Za-z]*))", |
| 622 |
"end": "(?=.)", |
| 623 |
"applyEndPatternLast": 1, |
| 624 |
"beginCaptures": { |
| 625 |
"1": { |
| 626 |
"name": "entity.name.function.directive.graphql" |
| 627 |
} |
| 628 |
}, |
| 629 |
"patterns": [ |
| 630 |
{ |
| 631 |
"include": "#graphql-comment" |
| 632 |
}, |
| 633 |
{ |
| 634 |
"include": "#graphql-description-docstring" |
| 635 |
}, |
| 636 |
{ |
| 637 |
"include": "#graphql-description-singleline" |
| 638 |
}, |
| 639 |
{ |
| 640 |
"include": "#graphql-arguments" |
| 641 |
}, |
| 642 |
{ |
| 643 |
"include": "#literal-quasi-embedded" |
| 644 |
}, |
| 645 |
{ |
| 646 |
"include": "#graphql-skip-newlines" |
| 647 |
} |
| 648 |
] |
| 649 |
}, |
| 650 |
"graphql-directive-definition": { |
| 651 |
"begin": "\\s*(\\bdirective\\b)\\s*(@[_A-Za-z][_0-9A-Za-z]*)", |
| 652 |
"end": "(?=.)", |
| 653 |
"applyEndPatternLast": 1, |
| 654 |
"beginCaptures": { |
| 655 |
"1": { |
| 656 |
"name": "keyword.directive.graphql" |
| 657 |
}, |
| 658 |
"2": { |
| 659 |
"name": "entity.name.function.directive.graphql" |
| 660 |
}, |
| 661 |
"3": { |
| 662 |
"name": "keyword.on.graphql" |
| 663 |
}, |
| 664 |
"4": { |
| 665 |
"name": "support.type.graphql" |
| 666 |
} |
| 667 |
}, |
| 668 |
"patterns": [ |
| 669 |
{ |
| 670 |
"include": "#graphql-variable-definitions" |
| 671 |
}, |
| 672 |
{ |
| 673 |
"begin": "\\s*(\\bon\\b)\\s*([_A-Za-z]*)", |
| 674 |
"end": "(?=.)", |
| 675 |
"applyEndPatternLast": 1, |
| 676 |
"beginCaptures": { |
| 677 |
"1": { |
| 678 |
"name": "keyword.on.graphql" |
| 679 |
}, |
| 680 |
"2": { |
| 681 |
"name": "support.type.location.graphql" |
| 682 |
} |
| 683 |
}, |
| 684 |
"patterns": [ |
| 685 |
{ |
| 686 |
"include": "#graphql-skip-newlines" |
| 687 |
}, |
| 688 |
{ |
| 689 |
"include": "#graphql-comment" |
| 690 |
}, |
| 691 |
{ |
| 692 |
"include": "#literal-quasi-embedded" |
| 693 |
}, |
| 694 |
{ |
| 695 |
"match": "\\s*(\\|)\\s*([_A-Za-z]*)", |
| 696 |
"captures": { |
| 697 |
"2": { |
| 698 |
"name": "support.type.location.graphql" |
| 699 |
} |
| 700 |
} |
| 701 |
} |
| 702 |
] |
| 703 |
}, |
| 704 |
{ |
| 705 |
"include": "#graphql-skip-newlines" |
| 706 |
}, |
| 707 |
{ |
| 708 |
"include": "#graphql-comment" |
| 709 |
}, |
| 710 |
{ |
| 711 |
"include": "#literal-quasi-embedded" |
| 712 |
} |
| 713 |
] |
| 714 |
}, |
| 715 |
"graphql-selection-set": { |
| 716 |
"name": "meta.selectionset.graphql", |
| 717 |
"begin": "\\s*({)", |
| 718 |
"end": "\\s*(})", |
| 719 |
"beginCaptures": { |
| 720 |
"1": { |
| 721 |
"name": "punctuation.operation.graphql" |
| 722 |
} |
| 723 |
}, |
| 724 |
"endCaptures": { |
| 725 |
"1": { |
| 726 |
"name": "punctuation.operation.graphql" |
| 727 |
} |
| 728 |
}, |
| 729 |
"patterns": [ |
| 730 |
{ |
| 731 |
"include": "#graphql-comment" |
| 732 |
}, |
| 733 |
{ |
| 734 |
"include": "#graphql-description-docstring" |
| 735 |
}, |
| 736 |
{ |
| 737 |
"include": "#graphql-description-singleline" |
| 738 |
}, |
| 739 |
{ |
| 740 |
"include": "#graphql-field" |
| 741 |
}, |
| 742 |
{ |
| 743 |
"include": "#graphql-fragment-spread" |
| 744 |
}, |
| 745 |
{ |
| 746 |
"include": "#graphql-inline-fragment" |
| 747 |
}, |
| 748 |
{ |
| 749 |
"include": "#graphql-comma" |
| 750 |
}, |
| 751 |
{ |
| 752 |
"include": "#native-interpolation" |
| 753 |
}, |
| 754 |
{ |
| 755 |
"include": "#literal-quasi-embedded" |
| 756 |
} |
| 757 |
] |
| 758 |
}, |
| 759 |
"graphql-field": { |
| 760 |
"patterns": [ |
| 761 |
{ |
| 762 |
"match": "\\s*([_A-Za-z][_0-9A-Za-z]*)\\s*(:)", |
| 763 |
"captures": { |
| 764 |
"1": { |
| 765 |
"name": "string.unquoted.alias.graphql" |
| 766 |
}, |
| 767 |
"2": { |
| 768 |
"name": "punctuation.colon.graphql" |
| 769 |
} |
| 770 |
} |
| 771 |
}, |
| 772 |
{ |
| 773 |
"match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 774 |
"captures": { |
| 775 |
"1": { |
| 776 |
"name": "variable.graphql" |
| 777 |
} |
| 778 |
} |
| 779 |
}, |
| 780 |
{ |
| 781 |
"include": "#graphql-arguments" |
| 782 |
}, |
| 783 |
{ |
| 784 |
"include": "#graphql-directive" |
| 785 |
}, |
| 786 |
{ |
| 787 |
"include": "#graphql-selection-set" |
| 788 |
}, |
| 789 |
{ |
| 790 |
"include": "#literal-quasi-embedded" |
| 791 |
}, |
| 792 |
{ |
| 793 |
"include": "#graphql-skip-newlines" |
| 794 |
} |
| 795 |
] |
| 796 |
}, |
| 797 |
"graphql-fragment-spread": { |
| 798 |
"begin": "\\s*(\\.\\.\\.)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)", |
| 799 |
"end": "(?=.)", |
| 800 |
"applyEndPatternLast": 1, |
| 801 |
"captures": { |
| 802 |
"1": { |
| 803 |
"name": "keyword.operator.spread.graphql" |
| 804 |
}, |
| 805 |
"2": { |
| 806 |
"name": "variable.fragment.graphql" |
| 807 |
} |
| 808 |
}, |
| 809 |
"patterns": [ |
| 810 |
{ |
| 811 |
"include": "#graphql-comment" |
| 812 |
}, |
| 813 |
{ |
| 814 |
"include": "#graphql-description-docstring" |
| 815 |
}, |
| 816 |
{ |
| 817 |
"include": "#graphql-description-singleline" |
| 818 |
}, |
| 819 |
{ |
| 820 |
"include": "#graphql-selection-set" |
| 821 |
}, |
| 822 |
{ |
| 823 |
"include": "#graphql-directive" |
| 824 |
}, |
| 825 |
{ |
| 826 |
"include": "#literal-quasi-embedded" |
| 827 |
}, |
| 828 |
{ |
| 829 |
"include": "#graphql-skip-newlines" |
| 830 |
} |
| 831 |
] |
| 832 |
}, |
| 833 |
"graphql-inline-fragment": { |
| 834 |
"begin": "\\s*(\\.\\.\\.)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*))?", |
| 835 |
"end": "(?=.)", |
| 836 |
"applyEndPatternLast": 1, |
| 837 |
"captures": { |
| 838 |
"1": { |
| 839 |
"name": "keyword.operator.spread.graphql" |
| 840 |
}, |
| 841 |
"2": { |
| 842 |
"name": "keyword.on.graphql" |
| 843 |
}, |
| 844 |
"3": { |
| 845 |
"name": "support.type.graphql" |
| 846 |
} |
| 847 |
}, |
| 848 |
"patterns": [ |
| 849 |
{ |
| 850 |
"include": "#graphql-comment" |
| 851 |
}, |
| 852 |
{ |
| 853 |
"include": "#graphql-description-docstring" |
| 854 |
}, |
| 855 |
{ |
| 856 |
"include": "#graphql-description-singleline" |
| 857 |
}, |
| 858 |
{ |
| 859 |
"include": "#graphql-selection-set" |
| 860 |
}, |
| 861 |
{ |
| 862 |
"include": "#graphql-directive" |
| 863 |
}, |
| 864 |
{ |
| 865 |
"include": "#graphql-skip-newlines" |
| 866 |
}, |
| 867 |
{ |
| 868 |
"include": "#literal-quasi-embedded" |
| 869 |
} |
| 870 |
] |
| 871 |
}, |
| 872 |
"graphql-arguments": { |
| 873 |
"name": "meta.arguments.graphql", |
| 874 |
"begin": "\\s*(\\()", |
| 875 |
"end": "\\s*(\\))", |
| 876 |
"beginCaptures": { |
| 877 |
"1": { |
| 878 |
"name": "meta.brace.round.directive.graphql" |
| 879 |
} |
| 880 |
}, |
| 881 |
"endCaptures": { |
| 882 |
"1": { |
| 883 |
"name": "meta.brace.round.directive.graphql" |
| 884 |
} |
| 885 |
}, |
| 886 |
"patterns": [ |
| 887 |
{ |
| 888 |
"include": "#graphql-comment" |
| 889 |
}, |
| 890 |
{ |
| 891 |
"include": "#graphql-description-docstring" |
| 892 |
}, |
| 893 |
{ |
| 894 |
"include": "#graphql-description-singleline" |
| 895 |
}, |
| 896 |
{ |
| 897 |
"begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))", |
| 898 |
"end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", |
| 899 |
"beginCaptures": { |
| 900 |
"1": { |
| 901 |
"name": "variable.parameter.graphql" |
| 902 |
}, |
| 903 |
"2": { |
| 904 |
"name": "punctuation.colon.graphql" |
| 905 |
} |
| 906 |
}, |
| 907 |
"endCaptures": { |
| 908 |
"3": { |
| 909 |
"name": "punctuation.comma.graphql" |
| 910 |
} |
| 911 |
}, |
| 912 |
"patterns": [ |
| 913 |
{ |
| 914 |
"include": "#graphql-comment" |
| 915 |
}, |
| 916 |
{ |
| 917 |
"include": "#graphql-description-docstring" |
| 918 |
}, |
| 919 |
{ |
| 920 |
"include": "#graphql-description-singleline" |
| 921 |
}, |
| 922 |
{ |
| 923 |
"include": "#graphql-directive" |
| 924 |
}, |
| 925 |
{ |
| 926 |
"include": "#graphql-value" |
| 927 |
}, |
| 928 |
{ |
| 929 |
"include": "#graphql-skip-newlines" |
| 930 |
} |
| 931 |
] |
| 932 |
}, |
| 933 |
{ |
| 934 |
"include": "#literal-quasi-embedded" |
| 935 |
} |
| 936 |
] |
| 937 |
}, |
| 938 |
"graphql-variable-name": { |
| 939 |
"match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)", |
| 940 |
"captures": { |
| 941 |
"1": { |
| 942 |
"name": "variable.graphql" |
| 943 |
} |
| 944 |
} |
| 945 |
}, |
| 946 |
"graphql-float-value": { |
| 947 |
"match": "\\s*(-?(0|[1-9][0-9]*)(\\.[0-9]+)?((e|E)(\\+|-)?[0-9]+)?)", |
| 948 |
"captures": { |
| 949 |
"1": { |
| 950 |
"name": "constant.numeric.float.graphql" |
| 951 |
} |
| 952 |
} |
| 953 |
}, |
| 954 |
"graphql-boolean-value": { |
| 955 |
"match": "\\s*\\b(true|false)\\b", |
| 956 |
"captures": { |
| 957 |
"1": { |
| 958 |
"name": "constant.language.boolean.graphql" |
| 959 |
} |
| 960 |
} |
| 961 |
}, |
| 962 |
"graphql-null-value": { |
| 963 |
"match": "\\s*\\b(null)\\b", |
| 964 |
"captures": { |
| 965 |
"1": { |
| 966 |
"name": "constant.language.null.graphql" |
| 967 |
} |
| 968 |
} |
| 969 |
}, |
| 970 |
"graphql-string-value": { |
| 971 |
"contentName": "string.quoted.double.graphql", |
| 972 |
"begin": "\\s*+((\"))", |
| 973 |
"end": "\\s*+(?:((\"))|(\n))", |
| 974 |
"beginCaptures": { |
| 975 |
"1": { |
| 976 |
"name": "string.quoted.double.graphql" |
| 977 |
}, |
| 978 |
"2": { |
| 979 |
"name": "punctuation.definition.string.begin.graphql" |
| 980 |
} |
| 981 |
}, |
| 982 |
"endCaptures": { |
| 983 |
"1": { |
| 984 |
"name": "string.quoted.double.graphql" |
| 985 |
}, |
| 986 |
"2": { |
| 987 |
"name": "punctuation.definition.string.end.graphql" |
| 988 |
}, |
| 989 |
"3": { |
| 990 |
"name": "invalid.illegal.newline.graphql" |
| 991 |
} |
| 992 |
}, |
| 993 |
"patterns": [ |
| 994 |
{ |
| 995 |
"include": "#graphql-string-content" |
| 996 |
}, |
| 997 |
{ |
| 998 |
"include": "#literal-quasi-embedded" |
| 999 |
} |
| 1000 |
] |
| 1001 |
}, |
| 1002 |
"graphql-string-content": { |
| 1003 |
"patterns": [ |
| 1004 |
{ |
| 1005 |
"name": "constant.character.escape.graphql", |
| 1006 |
"match": "\\\\[/'\"\\\\nrtbf]" |
| 1007 |
}, |
| 1008 |
{ |
| 1009 |
"name": "constant.character.escape.graphql", |
| 1010 |
"match": "\\\\u([0-9a-fA-F]{4})" |
| 1011 |
} |
| 1012 |
] |
| 1013 |
}, |
| 1014 |
"graphql-enum": { |
| 1015 |
"name": "meta.enum.graphql", |
| 1016 |
"begin": "\\s*+\\b(enum)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 1017 |
"end": "(?<=})", |
| 1018 |
"beginCaptures": { |
| 1019 |
"1": { |
| 1020 |
"name": "keyword.enum.graphql" |
| 1021 |
}, |
| 1022 |
"2": { |
| 1023 |
"name": "support.type.enum.graphql" |
| 1024 |
} |
| 1025 |
}, |
| 1026 |
"patterns": [ |
| 1027 |
{ |
| 1028 |
"name": "meta.type.object.graphql", |
| 1029 |
"begin": "\\s*({)", |
| 1030 |
"end": "\\s*(})", |
| 1031 |
"beginCaptures": { |
| 1032 |
"1": { |
| 1033 |
"name": "punctuation.operation.graphql" |
| 1034 |
} |
| 1035 |
}, |
| 1036 |
"endCaptures": { |
| 1037 |
"1": { |
| 1038 |
"name": "punctuation.operation.graphql" |
| 1039 |
} |
| 1040 |
}, |
| 1041 |
"patterns": [ |
| 1042 |
{ |
| 1043 |
"include": "#graphql-object-type" |
| 1044 |
}, |
| 1045 |
{ |
| 1046 |
"include": "#graphql-comment" |
| 1047 |
}, |
| 1048 |
{ |
| 1049 |
"include": "#graphql-description-docstring" |
| 1050 |
}, |
| 1051 |
{ |
| 1052 |
"include": "#graphql-description-singleline" |
| 1053 |
}, |
| 1054 |
{ |
| 1055 |
"include": "#graphql-directive" |
| 1056 |
}, |
| 1057 |
{ |
| 1058 |
"include": "#graphql-enum-value" |
| 1059 |
}, |
| 1060 |
{ |
| 1061 |
"include": "#literal-quasi-embedded" |
| 1062 |
} |
| 1063 |
] |
| 1064 |
}, |
| 1065 |
{ |
| 1066 |
"include": "#graphql-comment" |
| 1067 |
}, |
| 1068 |
{ |
| 1069 |
"include": "#graphql-description-docstring" |
| 1070 |
}, |
| 1071 |
{ |
| 1072 |
"include": "#graphql-description-singleline" |
| 1073 |
}, |
| 1074 |
{ |
| 1075 |
"include": "#graphql-directive" |
| 1076 |
} |
| 1077 |
] |
| 1078 |
}, |
| 1079 |
"graphql-enum-value": { |
| 1080 |
"name": "constant.character.enum.graphql", |
| 1081 |
"match": "\\s*(?!=\\b(true|false|null)\\b)([_A-Za-z][_0-9A-Za-z]*)" |
| 1082 |
}, |
| 1083 |
"graphql-value": { |
| 1084 |
"patterns": [ |
| 1085 |
{ |
| 1086 |
"include": "#graphql-comment" |
| 1087 |
}, |
| 1088 |
{ |
| 1089 |
"include": "#graphql-description-docstring" |
| 1090 |
}, |
| 1091 |
{ |
| 1092 |
"include": "#graphql-variable-name" |
| 1093 |
}, |
| 1094 |
{ |
| 1095 |
"include": "#graphql-float-value" |
| 1096 |
}, |
| 1097 |
{ |
| 1098 |
"include": "#graphql-string-value" |
| 1099 |
}, |
| 1100 |
{ |
| 1101 |
"include": "#graphql-boolean-value" |
| 1102 |
}, |
| 1103 |
{ |
| 1104 |
"include": "#graphql-null-value" |
| 1105 |
}, |
| 1106 |
{ |
| 1107 |
"include": "#graphql-enum-value" |
| 1108 |
}, |
| 1109 |
{ |
| 1110 |
"include": "#graphql-list-value" |
| 1111 |
}, |
| 1112 |
{ |
| 1113 |
"include": "#graphql-object-value" |
| 1114 |
}, |
| 1115 |
{ |
| 1116 |
"include": "#literal-quasi-embedded" |
| 1117 |
} |
| 1118 |
] |
| 1119 |
}, |
| 1120 |
"graphql-list-value": { |
| 1121 |
"patterns": [ |
| 1122 |
{ |
| 1123 |
"name": "meta.listvalues.graphql", |
| 1124 |
"begin": "\\s*+(\\[)", |
| 1125 |
"end": "\\s*(\\])", |
| 1126 |
"endCaptures": { |
| 1127 |
"1": { |
| 1128 |
"name": "meta.brace.square.graphql" |
| 1129 |
} |
| 1130 |
}, |
| 1131 |
"beginCaptures": { |
| 1132 |
"1": { |
| 1133 |
"name": "meta.brace.square.graphql" |
| 1134 |
} |
| 1135 |
}, |
| 1136 |
"patterns": [ |
| 1137 |
{ |
| 1138 |
"include": "#graphql-value" |
| 1139 |
} |
| 1140 |
] |
| 1141 |
} |
| 1142 |
] |
| 1143 |
}, |
| 1144 |
"graphql-object-value": { |
| 1145 |
"patterns": [ |
| 1146 |
{ |
| 1147 |
"name": "meta.objectvalues.graphql", |
| 1148 |
"begin": "\\s*+({)", |
| 1149 |
"end": "\\s*(})", |
| 1150 |
"beginCaptures": { |
| 1151 |
"1": { |
| 1152 |
"name": "meta.brace.curly.graphql" |
| 1153 |
} |
| 1154 |
}, |
| 1155 |
"endCaptures": { |
| 1156 |
"1": { |
| 1157 |
"name": "meta.brace.curly.graphql" |
| 1158 |
} |
| 1159 |
}, |
| 1160 |
"patterns": [ |
| 1161 |
{ |
| 1162 |
"include": "#graphql-object-field" |
| 1163 |
}, |
| 1164 |
{ |
| 1165 |
"include": "#graphql-value" |
| 1166 |
} |
| 1167 |
] |
| 1168 |
} |
| 1169 |
] |
| 1170 |
}, |
| 1171 |
"graphql-object-field": { |
| 1172 |
"match": "\\s*(([_A-Za-z][_0-9A-Za-z]*))\\s*(:)", |
| 1173 |
"captures": { |
| 1174 |
"1": { |
| 1175 |
"name": "constant.object.key.graphql" |
| 1176 |
}, |
| 1177 |
"2": { |
| 1178 |
"name": "string.unquoted.graphql" |
| 1179 |
}, |
| 1180 |
"3": { |
| 1181 |
"name": "punctuation.graphql" |
| 1182 |
} |
| 1183 |
} |
| 1184 |
}, |
| 1185 |
"graphql-union": { |
| 1186 |
"begin": "\\s*\\b(union)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 1187 |
"end": "(?=.)", |
| 1188 |
"applyEndPatternLast": 1, |
| 1189 |
"captures": { |
| 1190 |
"1": { |
| 1191 |
"name": "keyword.union.graphql" |
| 1192 |
}, |
| 1193 |
"2": { |
| 1194 |
"name": "support.type.graphql" |
| 1195 |
} |
| 1196 |
}, |
| 1197 |
"patterns": [ |
| 1198 |
{ |
| 1199 |
"begin": "\\s*(=)\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 1200 |
"end": "(?=.)", |
| 1201 |
"applyEndPatternLast": 1, |
| 1202 |
"captures": { |
| 1203 |
"1": { |
| 1204 |
"name": "punctuation.assignment.graphql" |
| 1205 |
}, |
| 1206 |
"2": { |
| 1207 |
"name": "support.type.graphql" |
| 1208 |
} |
| 1209 |
}, |
| 1210 |
"patterns": [ |
| 1211 |
{ |
| 1212 |
"include": "#graphql-comment" |
| 1213 |
}, |
| 1214 |
{ |
| 1215 |
"include": "#graphql-description-docstring" |
| 1216 |
}, |
| 1217 |
{ |
| 1218 |
"include": "#graphql-description-singleline" |
| 1219 |
}, |
| 1220 |
{ |
| 1221 |
"include": "#graphql-skip-newlines" |
| 1222 |
}, |
| 1223 |
{ |
| 1224 |
"include": "#literal-quasi-embedded" |
| 1225 |
}, |
| 1226 |
{ |
| 1227 |
"match": "\\s*(\\|)\\s*([_A-Za-z][_0-9A-Za-z]*)", |
| 1228 |
"captures": { |
| 1229 |
"1": { |
| 1230 |
"name": "punctuation.or.graphql" |
| 1231 |
}, |
| 1232 |
"2": { |
| 1233 |
"name": "support.type.graphql" |
| 1234 |
} |
| 1235 |
} |
| 1236 |
} |
| 1237 |
] |
| 1238 |
}, |
| 1239 |
{ |
| 1240 |
"include": "#graphql-comment" |
| 1241 |
}, |
| 1242 |
{ |
| 1243 |
"include": "#graphql-description-docstring" |
| 1244 |
}, |
| 1245 |
{ |
| 1246 |
"include": "#graphql-description-singleline" |
| 1247 |
}, |
| 1248 |
{ |
| 1249 |
"include": "#graphql-skip-newlines" |
| 1250 |
}, |
| 1251 |
{ |
| 1252 |
"include": "#literal-quasi-embedded" |
| 1253 |
} |
| 1254 |
] |
| 1255 |
}, |
| 1256 |
"native-interpolation": { |
| 1257 |
"name": "native.interpolation", |
| 1258 |
"begin": "\\s*(\\${)", |
| 1259 |
"end": "(})", |
| 1260 |
"beginCaptures": { |
| 1261 |
"1": { |
| 1262 |
"name": "keyword.other.substitution.begin" |
| 1263 |
} |
| 1264 |
}, |
| 1265 |
"endCaptures": { |
| 1266 |
"1": { |
| 1267 |
"name": "keyword.other.substitution.end" |
| 1268 |
} |
| 1269 |
}, |
| 1270 |
"patterns": [ |
| 1271 |
{ |
| 1272 |
"include": "source.js" |
| 1273 |
}, |
| 1274 |
{ |
| 1275 |
"include": "source.ts" |
| 1276 |
}, |
| 1277 |
{ |
| 1278 |
"include": "source.js.jsx" |
| 1279 |
}, |
| 1280 |
{ |
| 1281 |
"include": "source.tsx" |
| 1282 |
} |
| 1283 |
] |
| 1284 |
}, |
| 1285 |
"graphql-skip-newlines": { |
| 1286 |
"match": "\\s*\n" |
| 1287 |
} |
| 1288 |
} |
| 1289 |
} |
| 1290 |
|