| 1 | { |
| 2 | "name": "JavaScript (with React support)", |
| 3 | "scopeName": "source.js", |
| 4 | "fileTypes": [".js", ".jsx"], |
| 5 | "uuid": "805375ec-d614-41f5-8993-5843fe63ea82", |
| 6 | "patterns": [ |
| 7 | { |
| 8 | "include": "#directives" |
| 9 | }, |
| 10 | { |
| 11 | "include": "#statements" |
| 12 | }, |
| 13 | { |
| 14 | "name": "comment.line.shebang.ts", |
| 15 | "match": "\\A(#!).*(?=$)", |
| 16 | "captures": { |
| 17 | "1": { |
| 18 | "name": "punctuation.definition.comment.ts" |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | ], |
| 23 | "repository": { |
| 24 | "statements": { |
| 25 | "patterns": [ |
| 26 | { |
| 27 | "include": "#string" |
| 28 | }, |
| 29 | { |
| 30 | "include": "#template" |
| 31 | }, |
| 32 | { |
| 33 | "include": "#comment" |
| 34 | }, |
| 35 | { |
| 36 | "include": "#literal" |
| 37 | }, |
| 38 | { |
| 39 | "include": "#declaration" |
| 40 | }, |
| 41 | { |
| 42 | "include": "#switch-statement" |
| 43 | }, |
| 44 | { |
| 45 | "include": "#for-loop" |
| 46 | }, |
| 47 | { |
| 48 | "include": "#after-operator-block" |
| 49 | }, |
| 50 | { |
| 51 | "include": "#decl-block" |
| 52 | }, |
| 53 | { |
| 54 | "include": "#control-statement" |
| 55 | }, |
| 56 | { |
| 57 | "include": "#expression" |
| 58 | }, |
| 59 | { |
| 60 | "include": "#punctuation-semicolon" |
| 61 | } |
| 62 | ] |
| 63 | }, |
| 64 | "var-expr": { |
| 65 | "name": "meta.var.expr.js", |
| 66 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(var|let|const(?!\\s+enum\\b))\\b(?!\\$)", |
| 67 | "beginCaptures": { |
| 68 | "1": { |
| 69 | "name": "keyword.control.export.js" |
| 70 | }, |
| 71 | "2": { |
| 72 | "name": "storage.type.js" |
| 73 | } |
| 74 | }, |
| 75 | "end": "(?=$|;|}|(\\s+(of|in)\\s+))", |
| 76 | "patterns": [ |
| 77 | { |
| 78 | "include": "#destructuring-variable" |
| 79 | }, |
| 80 | { |
| 81 | "include": "#var-single-variable" |
| 82 | }, |
| 83 | { |
| 84 | "include": "#variable-initializer" |
| 85 | }, |
| 86 | { |
| 87 | "include": "#comment" |
| 88 | }, |
| 89 | { |
| 90 | "include": "#punctuation-comma" |
| 91 | } |
| 92 | ] |
| 93 | }, |
| 94 | "var-single-variable": { |
| 95 | "patterns": [ |
| 96 | { |
| 97 | "name": "meta.var-single-variable.expr.js", |
| 98 | "begin": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))", |
| 99 | "beginCaptures": { |
| 100 | "1": { |
| 101 | "name": "entity.name.function.js" |
| 102 | } |
| 103 | }, |
| 104 | "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", |
| 105 | "patterns": [ |
| 106 | { |
| 107 | "include": "#type-annotation" |
| 108 | }, |
| 109 | { |
| 110 | "include": "#string" |
| 111 | }, |
| 112 | { |
| 113 | "include": "#comment" |
| 114 | } |
| 115 | ] |
| 116 | }, |
| 117 | { |
| 118 | "name": "meta.var-single-variable.expr.js", |
| 119 | "begin": "([_$[:alpha:]][_$[:alnum:]]*)", |
| 120 | "beginCaptures": { |
| 121 | "1": { |
| 122 | "name": "variable.other.readwrite.js" |
| 123 | } |
| 124 | }, |
| 125 | "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", |
| 126 | "patterns": [ |
| 127 | { |
| 128 | "include": "#type-annotation" |
| 129 | }, |
| 130 | { |
| 131 | "include": "#string" |
| 132 | }, |
| 133 | { |
| 134 | "include": "#comment" |
| 135 | } |
| 136 | ] |
| 137 | } |
| 138 | ] |
| 139 | }, |
| 140 | "destructuring-variable": { |
| 141 | "patterns": [ |
| 142 | { |
| 143 | "name": "meta.object-binding-pattern-variable.js", |
| 144 | "begin": "(?<!=|:|of|in)\\s*(?=\\{)", |
| 145 | "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", |
| 146 | "patterns": [ |
| 147 | { |
| 148 | "include": "#object-binding-pattern" |
| 149 | }, |
| 150 | { |
| 151 | "include": "#type-annotation" |
| 152 | }, |
| 153 | { |
| 154 | "include": "#comment" |
| 155 | } |
| 156 | ] |
| 157 | }, |
| 158 | { |
| 159 | "name": "meta.array-binding-pattern-variable.js", |
| 160 | "begin": "(?<!=|:|of|in)\\s*(?=\\[)", |
| 161 | "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", |
| 162 | "patterns": [ |
| 163 | { |
| 164 | "include": "#array-binding-pattern" |
| 165 | }, |
| 166 | { |
| 167 | "include": "#type-annotation" |
| 168 | }, |
| 169 | { |
| 170 | "include": "#comment" |
| 171 | } |
| 172 | ] |
| 173 | } |
| 174 | ] |
| 175 | }, |
| 176 | "object-binding-element": { |
| 177 | "patterns": [ |
| 178 | { |
| 179 | "include": "#comment" |
| 180 | }, |
| 181 | { |
| 182 | "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))", |
| 183 | "end": "(?=,|\\})", |
| 184 | "patterns": [ |
| 185 | { |
| 186 | "include": "#object-binding-element-propertyName" |
| 187 | }, |
| 188 | { |
| 189 | "include": "#binding-element" |
| 190 | } |
| 191 | ] |
| 192 | }, |
| 193 | { |
| 194 | "include": "#object-binding-pattern" |
| 195 | }, |
| 196 | { |
| 197 | "include": "#destructuring-variable-rest" |
| 198 | }, |
| 199 | { |
| 200 | "include": "#variable-initializer" |
| 201 | }, |
| 202 | { |
| 203 | "include": "#punctuation-comma" |
| 204 | } |
| 205 | ] |
| 206 | }, |
| 207 | "object-binding-element-propertyName": { |
| 208 | "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))", |
| 209 | "end": "(:)", |
| 210 | "endCaptures": { |
| 211 | "0": { |
| 212 | "name": "punctuation.destructuring.js" |
| 213 | } |
| 214 | }, |
| 215 | "patterns": [ |
| 216 | { |
| 217 | "include": "#string" |
| 218 | }, |
| 219 | { |
| 220 | "include": "#array-literal" |
| 221 | }, |
| 222 | { |
| 223 | "name": "variable.object.property.js", |
| 224 | "match": "([_$[:alpha:]][_$[:alnum:]]*)" |
| 225 | } |
| 226 | ] |
| 227 | }, |
| 228 | "binding-element": { |
| 229 | "patterns": [ |
| 230 | { |
| 231 | "include": "#comment" |
| 232 | }, |
| 233 | { |
| 234 | "include": "#object-binding-pattern" |
| 235 | }, |
| 236 | { |
| 237 | "include": "#array-binding-pattern" |
| 238 | }, |
| 239 | { |
| 240 | "include": "#destructuring-variable-rest" |
| 241 | }, |
| 242 | { |
| 243 | "include": "#variable-initializer" |
| 244 | } |
| 245 | ] |
| 246 | }, |
| 247 | "destructuring-variable-rest": { |
| 248 | "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", |
| 249 | "captures": { |
| 250 | "1": { |
| 251 | "name": "keyword.operator.rest.js" |
| 252 | }, |
| 253 | "2": { |
| 254 | "name": "variable.other.readwrite.js" |
| 255 | } |
| 256 | } |
| 257 | }, |
| 258 | "object-binding-pattern": { |
| 259 | "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", |
| 260 | "beginCaptures": { |
| 261 | "1": { |
| 262 | "name": "keyword.operator.rest.js" |
| 263 | }, |
| 264 | "2": { |
| 265 | "name": "punctuation.definition.binding-pattern.object.js" |
| 266 | } |
| 267 | }, |
| 268 | "end": "\\}", |
| 269 | "endCaptures": { |
| 270 | "0": { |
| 271 | "name": "punctuation.definition.binding-pattern.object.js" |
| 272 | } |
| 273 | }, |
| 274 | "patterns": [ |
| 275 | { |
| 276 | "include": "#object-binding-element" |
| 277 | } |
| 278 | ] |
| 279 | }, |
| 280 | "array-binding-pattern": { |
| 281 | "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", |
| 282 | "beginCaptures": { |
| 283 | "1": { |
| 284 | "name": "keyword.operator.rest.js" |
| 285 | }, |
| 286 | "2": { |
| 287 | "name": "punctuation.definition.binding-pattern.array.js" |
| 288 | } |
| 289 | }, |
| 290 | "end": "\\]", |
| 291 | "endCaptures": { |
| 292 | "0": { |
| 293 | "name": "punctuation.definition.binding-pattern.array.js" |
| 294 | } |
| 295 | }, |
| 296 | "patterns": [ |
| 297 | { |
| 298 | "include": "#binding-element" |
| 299 | }, |
| 300 | { |
| 301 | "include": "#punctuation-comma" |
| 302 | } |
| 303 | ] |
| 304 | }, |
| 305 | "ternary-expression": { |
| 306 | "begin": "(?=\\?)", |
| 307 | "end": "(?=$|[;,})\\]])", |
| 308 | "patterns": [ |
| 309 | { |
| 310 | "include": "#ternary-operator" |
| 311 | }, |
| 312 | { |
| 313 | "include": "#expression" |
| 314 | } |
| 315 | ] |
| 316 | }, |
| 317 | "ternary-operator": { |
| 318 | "begin": "(\\?)", |
| 319 | "beginCaptures": { |
| 320 | "0": { |
| 321 | "name": "keyword.operator.ternary.js" |
| 322 | } |
| 323 | }, |
| 324 | "end": "(:)", |
| 325 | "endCaptures": { |
| 326 | "0": { |
| 327 | "name": "keyword.operator.ternary.js" |
| 328 | } |
| 329 | }, |
| 330 | "patterns": [ |
| 331 | { |
| 332 | "include": "#expression" |
| 333 | } |
| 334 | ] |
| 335 | }, |
| 336 | "expression": { |
| 337 | "name": "meta.expression.js", |
| 338 | "patterns": [ |
| 339 | { |
| 340 | "include": "#jsx" |
| 341 | }, |
| 342 | { |
| 343 | "include": "#string" |
| 344 | }, |
| 345 | { |
| 346 | "include": "#regex" |
| 347 | }, |
| 348 | { |
| 349 | "include": "#template" |
| 350 | }, |
| 351 | { |
| 352 | "include": "#comment" |
| 353 | }, |
| 354 | { |
| 355 | "include": "#literal" |
| 356 | }, |
| 357 | { |
| 358 | "include": "#function-declaration" |
| 359 | }, |
| 360 | { |
| 361 | "include": "#class-or-interface-declaration" |
| 362 | }, |
| 363 | { |
| 364 | "include": "#arrow-function" |
| 365 | }, |
| 366 | { |
| 367 | "include": "#cast" |
| 368 | }, |
| 369 | { |
| 370 | "include": "#ternary-expression" |
| 371 | }, |
| 372 | { |
| 373 | "include": "#new-expr" |
| 374 | }, |
| 375 | { |
| 376 | "include": "#object-literal" |
| 377 | }, |
| 378 | { |
| 379 | "include": "#expression-operators" |
| 380 | }, |
| 381 | { |
| 382 | "include": "#function-call" |
| 383 | }, |
| 384 | { |
| 385 | "include": "#support-objects" |
| 386 | }, |
| 387 | { |
| 388 | "include": "#identifiers" |
| 389 | }, |
| 390 | { |
| 391 | "include": "#paren-expression" |
| 392 | }, |
| 393 | { |
| 394 | "include": "#punctuation-comma" |
| 395 | }, |
| 396 | { |
| 397 | "include": "#punctuation-accessor" |
| 398 | } |
| 399 | ] |
| 400 | }, |
| 401 | "control-statement": { |
| 402 | "patterns": [ |
| 403 | { |
| 404 | "name": "keyword.control.trycatch.js", |
| 405 | "match": "(?<!\\.|\\$)\\b(catch|finally|throw|try)\\b(?!\\$)" |
| 406 | }, |
| 407 | { |
| 408 | "name": "keyword.control.loop.js", |
| 409 | "match": "(?<!\\.|\\$)\\b(break|continue|do|goto|while)\\b(?!\\$)" |
| 410 | }, |
| 411 | { |
| 412 | "name": "keyword.control.flow.js", |
| 413 | "match": "(?<!\\.|\\$)\\b(return)\\b(?!\\$)" |
| 414 | }, |
| 415 | { |
| 416 | "match": "(?<!\\.|\\$)\\b(yield)\\b(?!\\$)(?:\\s*(\\*))?", |
| 417 | "captures": { |
| 418 | "1": { |
| 419 | "name": "keyword.control.flow.js" |
| 420 | }, |
| 421 | "2": { |
| 422 | "name": "keyword.generator.asterisk.js" |
| 423 | } |
| 424 | } |
| 425 | }, |
| 426 | { |
| 427 | "name": "keyword.control.switch.js", |
| 428 | "match": "(?<!\\.|\\$)\\b(case|default|switch)\\b(?!\\$)" |
| 429 | }, |
| 430 | { |
| 431 | "name": "keyword.control.conditional.js", |
| 432 | "match": "(?<!\\.|\\$)\\b(else|if)\\b(?!\\$)" |
| 433 | }, |
| 434 | { |
| 435 | "name": "keyword.control.with.js", |
| 436 | "match": "(?<!\\.|\\$)\\b(with)\\b(?!\\$)" |
| 437 | }, |
| 438 | { |
| 439 | "name": "keyword.other.debugger.js", |
| 440 | "match": "(?<!\\.|\\$)\\b(debugger)\\b(?!\\$)" |
| 441 | }, |
| 442 | { |
| 443 | "name": "storage.modifier.js", |
| 444 | "match": "(?<!\\.|\\$)\\b(declare)\\b(?!\\$)" |
| 445 | } |
| 446 | ] |
| 447 | }, |
| 448 | "declaration": { |
| 449 | "name": "meta.declaration.js", |
| 450 | "patterns": [ |
| 451 | { |
| 452 | "include": "#decorator" |
| 453 | }, |
| 454 | { |
| 455 | "include": "#var-expr" |
| 456 | }, |
| 457 | { |
| 458 | "include": "#function-declaration" |
| 459 | }, |
| 460 | { |
| 461 | "include": "#class-or-interface-declaration" |
| 462 | }, |
| 463 | { |
| 464 | "include": "#type-declaration" |
| 465 | }, |
| 466 | { |
| 467 | "include": "#enum-declaration" |
| 468 | }, |
| 469 | { |
| 470 | "include": "#namespace-declaration" |
| 471 | }, |
| 472 | { |
| 473 | "include": "#import-equals-declaration" |
| 474 | }, |
| 475 | { |
| 476 | "include": "#import-declaration" |
| 477 | }, |
| 478 | { |
| 479 | "include": "#export-declaration" |
| 480 | } |
| 481 | ] |
| 482 | }, |
| 483 | "decorator": { |
| 484 | "name": "meta.decorator.js", |
| 485 | "begin": "(?<!\\.|\\$)\\@", |
| 486 | "beginCaptures": { |
| 487 | "0": { |
| 488 | "name": "punctuation.decorator.js" |
| 489 | } |
| 490 | }, |
| 491 | "end": "(?=\\s)", |
| 492 | "patterns": [ |
| 493 | { |
| 494 | "include": "#expression" |
| 495 | } |
| 496 | ] |
| 497 | }, |
| 498 | "type-declaration": { |
| 499 | "name": "meta.type.declaration.js", |
| 500 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(type)\\b\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*", |
| 501 | "beginCaptures": { |
| 502 | "1": { |
| 503 | "name": "keyword.control.export.js" |
| 504 | }, |
| 505 | "2": { |
| 506 | "name": "storage.type.type.js" |
| 507 | }, |
| 508 | "3": { |
| 509 | "name": "entity.name.type.js" |
| 510 | } |
| 511 | }, |
| 512 | "end": "(?=[};]|\\bvar\\b|\\blet\\b|\\bconst\\b|\\btype\\b|\\bfunction\\b|\\bclass\\b|\\binterface\\b|\\bnamespace\\b|\\bmodule\\b|\\bimport\\b|\\benum\\b|\\bdeclare\\b|\\bexport\\b|\\babstract\\b|\\basync\\b)", |
| 513 | "patterns": [ |
| 514 | { |
| 515 | "include": "#comment" |
| 516 | }, |
| 517 | { |
| 518 | "include": "#type-parameters" |
| 519 | }, |
| 520 | { |
| 521 | "include": "#type" |
| 522 | }, |
| 523 | { |
| 524 | "match": "(=)\\s*", |
| 525 | "captures": { |
| 526 | "1": { |
| 527 | "name": "keyword.operator.assignment.js" |
| 528 | } |
| 529 | } |
| 530 | } |
| 531 | ] |
| 532 | }, |
| 533 | "enum-declaration": { |
| 534 | "name": "meta.enum.declaration.js", |
| 535 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)", |
| 536 | "beginCaptures": { |
| 537 | "1": { |
| 538 | "name": "keyword.control.export.js" |
| 539 | }, |
| 540 | "2": { |
| 541 | "name": "storage.modifier.js" |
| 542 | }, |
| 543 | "3": { |
| 544 | "name": "storage.type.enum.js" |
| 545 | }, |
| 546 | "4": { |
| 547 | "name": "entity.name.type.enum.js" |
| 548 | } |
| 549 | }, |
| 550 | "end": "(?<=\\})", |
| 551 | "patterns": [ |
| 552 | { |
| 553 | "include": "#comment" |
| 554 | }, |
| 555 | { |
| 556 | "begin": "\\{", |
| 557 | "beginCaptures": { |
| 558 | "0": { |
| 559 | "name": "punctuation.definition.block.js" |
| 560 | } |
| 561 | }, |
| 562 | "end": "\\}", |
| 563 | "endCaptures": { |
| 564 | "0": { |
| 565 | "name": "punctuation.definition.block.js" |
| 566 | } |
| 567 | }, |
| 568 | "patterns": [ |
| 569 | { |
| 570 | "include": "#comment" |
| 571 | }, |
| 572 | { |
| 573 | "begin": "([_$[:alpha:]][_$[:alnum:]]*)", |
| 574 | "beginCaptures": { |
| 575 | "0": { |
| 576 | "name": "variable.other.enummember.js" |
| 577 | } |
| 578 | }, |
| 579 | "end": "(?=,|\\}|$)", |
| 580 | "patterns": [ |
| 581 | { |
| 582 | "include": "#comment" |
| 583 | }, |
| 584 | { |
| 585 | "include": "#variable-initializer" |
| 586 | } |
| 587 | ] |
| 588 | }, |
| 589 | { |
| 590 | "begin": "(?=((\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\])))", |
| 591 | "end": "(?=,|\\}|$)", |
| 592 | "patterns": [ |
| 593 | { |
| 594 | "include": "#string" |
| 595 | }, |
| 596 | { |
| 597 | "include": "#array-literal" |
| 598 | }, |
| 599 | { |
| 600 | "include": "#comment" |
| 601 | }, |
| 602 | { |
| 603 | "include": "#variable-initializer" |
| 604 | } |
| 605 | ] |
| 606 | }, |
| 607 | { |
| 608 | "include": "#punctuation-comma" |
| 609 | } |
| 610 | ] |
| 611 | } |
| 612 | ] |
| 613 | }, |
| 614 | "namespace-declaration": { |
| 615 | "name": "meta.namespace.declaration.js", |
| 616 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(namespace|module)\\s+", |
| 617 | "beginCaptures": { |
| 618 | "1": { |
| 619 | "name": "keyword.control.export.js" |
| 620 | }, |
| 621 | "2": { |
| 622 | "name": "storage.type.namespace.js" |
| 623 | } |
| 624 | }, |
| 625 | "end": "(?=$|\\{)", |
| 626 | "patterns": [ |
| 627 | { |
| 628 | "include": "#comment" |
| 629 | }, |
| 630 | { |
| 631 | "include": "#string" |
| 632 | }, |
| 633 | { |
| 634 | "name": "entity.name.type.module.js", |
| 635 | "match": "([_$[:alpha:]][_$[:alnum:]]*)" |
| 636 | }, |
| 637 | { |
| 638 | "name": "punctuation.accessor.js", |
| 639 | "match": "\\." |
| 640 | } |
| 641 | ] |
| 642 | }, |
| 643 | "import-equals-declaration": { |
| 644 | "patterns": [ |
| 645 | { |
| 646 | "name": "meta.import-equals.external.js", |
| 647 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(require)\\s*(\\()", |
| 648 | "beginCaptures": { |
| 649 | "1": { |
| 650 | "name": "keyword.control.export.js" |
| 651 | }, |
| 652 | "2": { |
| 653 | "name": "keyword.control.import.js" |
| 654 | }, |
| 655 | "3": { |
| 656 | "name": "variable.other.readwrite.alias.js" |
| 657 | }, |
| 658 | "4": { |
| 659 | "name": "keyword.operator.assignment.js" |
| 660 | }, |
| 661 | "5": { |
| 662 | "name": "keyword.control.require.js" |
| 663 | }, |
| 664 | "6": { |
| 665 | "name": "meta.brace.round.js" |
| 666 | } |
| 667 | }, |
| 668 | "end": "\\)", |
| 669 | "endCaptures": { |
| 670 | "0": { |
| 671 | "name": "meta.brace.round.js" |
| 672 | } |
| 673 | }, |
| 674 | "patterns": [ |
| 675 | { |
| 676 | "include": "#comment" |
| 677 | }, |
| 678 | { |
| 679 | "include": "#string" |
| 680 | } |
| 681 | ] |
| 682 | }, |
| 683 | { |
| 684 | "name": "meta.import-equals.internal.js", |
| 685 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(?!require\\b)", |
| 686 | "beginCaptures": { |
| 687 | "1": { |
| 688 | "name": "keyword.control.export.js" |
| 689 | }, |
| 690 | "2": { |
| 691 | "name": "keyword.control.import.js" |
| 692 | }, |
| 693 | "3": { |
| 694 | "name": "variable.other.readwrite.alias.js" |
| 695 | }, |
| 696 | "4": { |
| 697 | "name": "keyword.operator.assignment.js" |
| 698 | } |
| 699 | }, |
| 700 | "end": "(?=;|$)", |
| 701 | "patterns": [ |
| 702 | { |
| 703 | "include": "#comment" |
| 704 | }, |
| 705 | { |
| 706 | "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)", |
| 707 | "captures": { |
| 708 | "1": { |
| 709 | "name": "entity.name.type.module.js" |
| 710 | }, |
| 711 | "2": { |
| 712 | "name": "punctuation.accessor.js" |
| 713 | } |
| 714 | } |
| 715 | }, |
| 716 | { |
| 717 | "name": "variable.other.readwrite.js", |
| 718 | "match": "([_$[:alpha:]][_$[:alnum:]]*)" |
| 719 | } |
| 720 | ] |
| 721 | } |
| 722 | ] |
| 723 | }, |
| 724 | "import-declaration": { |
| 725 | "name": "meta.import.js", |
| 726 | "begin": "(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*:)|(\\$))\\b", |
| 727 | "beginCaptures": { |
| 728 | "1": { |
| 729 | "name": "keyword.control.export.js" |
| 730 | }, |
| 731 | "2": { |
| 732 | "name": "keyword.control.import.js" |
| 733 | } |
| 734 | }, |
| 735 | "end": "(?=;|$)", |
| 736 | "patterns": [ |
| 737 | { |
| 738 | "include": "#import-export-declaration" |
| 739 | } |
| 740 | ] |
| 741 | }, |
| 742 | "export-declaration": { |
| 743 | "patterns": [ |
| 744 | { |
| 745 | "match": "(?<!\\.|\\$)\\b(export)\\s+(as)\\s+(namespace)\\s+([_$[:alpha:]][_$[:alnum:]]*)", |
| 746 | "captures": { |
| 747 | "1": { |
| 748 | "name": "keyword.control.export.js" |
| 749 | }, |
| 750 | "2": { |
| 751 | "name": "keyword.control.as.js" |
| 752 | }, |
| 753 | "3": { |
| 754 | "name": "storage.type.namespace.js" |
| 755 | }, |
| 756 | "4": { |
| 757 | "name": "entity.name.type.module.js" |
| 758 | } |
| 759 | } |
| 760 | }, |
| 761 | { |
| 762 | "name": "meta.export.default.js", |
| 763 | "begin": "(?<!\\.|\\$)\\b(export)(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))", |
| 764 | "beginCaptures": { |
| 765 | "1": { |
| 766 | "name": "keyword.control.export.js" |
| 767 | }, |
| 768 | "2": { |
| 769 | "name": "keyword.operator.assignment.js" |
| 770 | }, |
| 771 | "3": { |
| 772 | "name": "keyword.control.default.js" |
| 773 | } |
| 774 | }, |
| 775 | "end": "(?=;|\\bexport\\b|\\bfunction\\b|\\bclass\\b|\\binterface\\b|\\blet\\b|\\bvar\\b|\\bconst\\b|\\bimport\\b|\\benum\\b|\\bnamespace\\b|\\bmodule\\b|\\btype\\b|\\babstract\\b|\\bdeclare\\b|\\basync\\b|$)", |
| 776 | "patterns": [ |
| 777 | { |
| 778 | "include": "#expression" |
| 779 | } |
| 780 | ] |
| 781 | }, |
| 782 | { |
| 783 | "name": "meta.export.js", |
| 784 | "begin": "(?<!\\.|\\$)\\b(export)(?!(\\s*:)|(\\$))\\b", |
| 785 | "beginCaptures": { |
| 786 | "0": { |
| 787 | "name": "keyword.control.export.js" |
| 788 | } |
| 789 | }, |
| 790 | "end": "(?=;|\\bexport\\b|\\bfunction\\b|\\bclass\\b|\\binterface\\b|\\blet\\b|\\bvar\\b|\\bconst\\b|\\bimport\\b|\\benum\\b|\\bnamespace\\b|\\bmodule\\b|\\btype\\b|\\babstract\\b|\\bdeclare\\b|\\basync\\b|$)", |
| 791 | "patterns": [ |
| 792 | { |
| 793 | "include": "#import-export-declaration" |
| 794 | } |
| 795 | ] |
| 796 | } |
| 797 | ] |
| 798 | }, |
| 799 | "import-export-declaration": { |
| 800 | "patterns": [ |
| 801 | { |
| 802 | "include": "#comment" |
| 803 | }, |
| 804 | { |
| 805 | "include": "#string" |
| 806 | }, |
| 807 | { |
| 808 | "include": "#import-export-block" |
| 809 | }, |
| 810 | { |
| 811 | "name": "keyword.control.from.js", |
| 812 | "match": "\\bfrom\\b" |
| 813 | }, |
| 814 | { |
| 815 | "include": "#import-export-clause" |
| 816 | } |
| 817 | ] |
| 818 | }, |
| 819 | "import-export-block": { |
| 820 | "name": "meta.block.js", |
| 821 | "begin": "\\{", |
| 822 | "beginCaptures": { |
| 823 | "0": { |
| 824 | "name": "punctuation.definition.block.js" |
| 825 | } |
| 826 | }, |
| 827 | "end": "\\}", |
| 828 | "endCaptures": { |
| 829 | "0": { |
| 830 | "name": "punctuation.definition.block.js" |
| 831 | } |
| 832 | }, |
| 833 | "patterns": [ |
| 834 | { |
| 835 | "include": "#import-export-clause" |
| 836 | } |
| 837 | ] |
| 838 | }, |
| 839 | "import-export-clause": { |
| 840 | "patterns": [ |
| 841 | { |
| 842 | "include": "#comment" |
| 843 | }, |
| 844 | { |
| 845 | "comment": "(default|*|name) as alias", |
| 846 | "match": "(?x) (?: \\b(default)\\b | (\\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \\s+ (as) \\s+ (?: (\\b default \\b | \\*) | ([_$[:alpha:]][_$[:alnum:]]*))", |
| 847 | "captures": { |
| 848 | "1": { |
| 849 | "name": "keyword.control.default.js" |
| 850 | }, |
| 851 | "2": { |
| 852 | "name": "constant.language.import-export-all.js" |
| 853 | }, |
| 854 | "3": { |
| 855 | "name": "variable.other.readwrite.js" |
| 856 | }, |
| 857 | "4": { |
| 858 | "name": "keyword.control.as.js" |
| 859 | }, |
| 860 | "5": { |
| 861 | "name": "invalid.illegal.js" |
| 862 | }, |
| 863 | "6": { |
| 864 | "name": "variable.other.readwrite.alias.js" |
| 865 | } |
| 866 | } |
| 867 | }, |
| 868 | { |
| 869 | "include": "#punctuation-comma" |
| 870 | }, |
| 871 | { |
| 872 | "name": "constant.language.import-export-all.js", |
| 873 | "match": "\\*" |
| 874 | }, |
| 875 | { |
| 876 | "name": "keyword.control.default.js", |
| 877 | "match": "\\b(default)\\b" |
| 878 | }, |
| 879 | { |
| 880 | "name": "variable.other.readwrite.alias.js", |
| 881 | "match": "([_$[:alpha:]][_$[:alnum:]]*)" |
| 882 | } |
| 883 | ] |
| 884 | }, |
| 885 | "class-or-interface-declaration": { |
| 886 | "name": "meta.class.js", |
| 887 | "begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?\\b(?:(abstract)\\s+)?\\b(?:(class)|(interface))\\b", |
| 888 | "beginCaptures": { |
| 889 | "1": { |
| 890 | "name": "keyword.control.export.js" |
| 891 | }, |
| 892 | "2": { |
| 893 | "name": "storage.modifier.js" |
| 894 | }, |
| 895 | "3": { |
| 896 | "name": "storage.type.class.js" |
| 897 | }, |
| 898 | "4": { |
| 899 | "name": "storage.type.interface.js" |
| 900 | } |
| 901 | }, |
| 902 | "end": "(?<=\\})", |
| 903 | "endCaptures": { |
| 904 | "1": { |
| 905 | "name": "punctuation.definition.block.js" |
| 906 | } |
| 907 | }, |
| 908 | "patterns": [ |
| 909 | { |
| 910 | "include": "#comment" |
| 911 | }, |
| 912 | { |
| 913 | "include": "#class-or-interface-heritage" |
| 914 | }, |
| 915 | { |
| 916 | "match": "[_$[:alpha:]][_$[:alnum:]]*", |
| 917 | "captures": { |
| 918 | "0": { |
| 919 | "name": "entity.name.type.class.js" |
| 920 | } |
| 921 | } |
| 922 | }, |
| 923 | { |
| 924 | "include": "#type-parameters" |
| 925 | }, |
| 926 | { |
| 927 | "include": "#class-or-interface-body" |
| 928 | } |
| 929 | ] |
| 930 | }, |
| 931 | "class-or-interface-heritage": { |
| 932 | "begin": "(?<!\\.|\\$)(?:\\b(extends|implements)\\b)(?!\\$)", |
| 933 | "beginCaptures": { |
| 934 | "1": { |
| 935 | "name": "storage.modifier.js" |
| 936 | } |
| 937 | }, |
| 938 | "end": "(?=\\{)", |
| 939 | "endCaptures": { |
| 940 | "1": { |
| 941 | "name": "punctuation.definition.block.js" |
| 942 | } |
| 943 | }, |
| 944 | "patterns": [ |
| 945 | { |
| 946 | "include": "#comment" |
| 947 | }, |
| 948 | { |
| 949 | "include": "#class-or-interface-heritage" |
| 950 | }, |
| 951 | { |
| 952 | "include": "#type-parameters" |
| 953 | }, |
| 954 | { |
| 955 | "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*([,<{]|extends|implements|//|/\\*))", |
| 956 | "captures": { |
| 957 | "1": { |
| 958 | "name": "entity.name.type.module.js" |
| 959 | }, |
| 960 | "2": { |
| 961 | "name": "punctuation.accessor.js" |
| 962 | } |
| 963 | } |
| 964 | }, |
| 965 | { |
| 966 | "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*([,<{]|extends|implements|//|/\\*))", |
| 967 | "captures": { |
| 968 | "1": { |
| 969 | "name": "entity.other.inherited-class.js" |
| 970 | } |
| 971 | } |
| 972 | }, |
| 973 | { |
| 974 | "include": "#expression" |
| 975 | } |
| 976 | ] |
| 977 | }, |
| 978 | "class-or-interface-body": { |
| 979 | "begin": "\\{", |
| 980 | "beginCaptures": { |
| 981 | "0": { |
| 982 | "name": "punctuation.definition.block.js" |
| 983 | } |
| 984 | }, |
| 985 | "end": "\\}", |
| 986 | "endCaptures": { |
| 987 | "0": { |
| 988 | "name": "punctuation.definition.block.js" |
| 989 | } |
| 990 | }, |
| 991 | "patterns": [ |
| 992 | { |
| 993 | "include": "#string" |
| 994 | }, |
| 995 | { |
| 996 | "include": "#comment" |
| 997 | }, |
| 998 | { |
| 999 | "include": "#decorator" |
| 1000 | }, |
| 1001 | { |
| 1002 | "include": "#method-declaration" |
| 1003 | }, |
| 1004 | { |
| 1005 | "include": "#indexer-declaration" |
| 1006 | }, |
| 1007 | { |
| 1008 | "include": "#field-declaration" |
| 1009 | }, |
| 1010 | { |
| 1011 | "include": "#type-annotation" |
| 1012 | }, |
| 1013 | { |
| 1014 | "include": "#variable-initializer" |
| 1015 | }, |
| 1016 | { |
| 1017 | "include": "#access-modifier" |
| 1018 | }, |
| 1019 | { |
| 1020 | "include": "#property-accessor" |
| 1021 | }, |
| 1022 | { |
| 1023 | "include": "#expression" |
| 1024 | }, |
| 1025 | { |
| 1026 | "include": "#punctuation-comma" |
| 1027 | }, |
| 1028 | { |
| 1029 | "include": "#punctuation-semicolon" |
| 1030 | } |
| 1031 | ] |
| 1032 | }, |
| 1033 | "type-object": { |
| 1034 | "name": "meta.object.type.js", |
| 1035 | "begin": "\\{", |
| 1036 | "beginCaptures": { |
| 1037 | "0": { |
| 1038 | "name": "punctuation.definition.block.js" |
| 1039 | } |
| 1040 | }, |
| 1041 | "end": "\\}", |
| 1042 | "endCaptures": { |
| 1043 | "0": { |
| 1044 | "name": "punctuation.definition.block.js" |
| 1045 | } |
| 1046 | }, |
| 1047 | "patterns": [ |
| 1048 | { |
| 1049 | "include": "#type-object-members" |
| 1050 | } |
| 1051 | ] |
| 1052 | }, |
| 1053 | "type-object-members": { |
| 1054 | "patterns": [ |
| 1055 | { |
| 1056 | "include": "#comment" |
| 1057 | }, |
| 1058 | { |
| 1059 | "include": "#method-declaration" |
| 1060 | }, |
| 1061 | { |
| 1062 | "include": "#indexer-declaration" |
| 1063 | }, |
| 1064 | { |
| 1065 | "include": "#field-declaration" |
| 1066 | }, |
| 1067 | { |
| 1068 | "include": "#type-annotation" |
| 1069 | }, |
| 1070 | { |
| 1071 | "begin": "\\.\\.\\.", |
| 1072 | "beginCaptures": { |
| 1073 | "0": { |
| 1074 | "name": "keyword.operator.spread.js" |
| 1075 | } |
| 1076 | }, |
| 1077 | "end": "(?=\\}|;|,|$)|(?<=\\})", |
| 1078 | "patterns": [ |
| 1079 | { |
| 1080 | "include": "#type" |
| 1081 | } |
| 1082 | ] |
| 1083 | }, |
| 1084 | { |
| 1085 | "include": "#punctuation-comma" |
| 1086 | }, |
| 1087 | { |
| 1088 | "include": "#punctuation-semicolon" |
| 1089 | } |
| 1090 | ] |
| 1091 | }, |
| 1092 | "field-declaration": { |
| 1093 | "name": "meta.field.declaration.js", |
| 1094 | "begin": "(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))", |
| 1095 | "beginCaptures": { |
| 1096 | "1": { |
| 1097 | "name": "storage.modifier.js" |
| 1098 | } |
| 1099 | }, |
| 1100 | "end": "(?=\\}|;|,|$)|(?<=\\})", |
| 1101 | "patterns": [ |
| 1102 | { |
| 1103 | "include": "#variable-initializer" |
| 1104 | }, |
| 1105 | { |
| 1106 | "begin": "(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))", |
| 1107 | "end": "(?=[};,=]|$)|(?<=\\})", |
| 1108 | "patterns": [ |
| 1109 | { |
| 1110 | "include": "#type-annotation" |
| 1111 | }, |
| 1112 | { |
| 1113 | "include": "#string" |
| 1114 | }, |
| 1115 | { |
| 1116 | "include": "#array-literal" |
| 1117 | }, |
| 1118 | { |
| 1119 | "include": "#comment" |
| 1120 | }, |
| 1121 | { |
| 1122 | "name": "entity.name.function.js", |
| 1123 | "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))" |
| 1124 | }, |
| 1125 | { |
| 1126 | "name": "variable.object.property.js", |
| 1127 | "match": "[_$[:alpha:]][_$[:alnum:]]*" |
| 1128 | }, |
| 1129 | { |
| 1130 | "name": "keyword.operator.optional.js", |
| 1131 | "match": "\\?" |
| 1132 | } |
| 1133 | ] |
| 1134 | } |
| 1135 | ] |
| 1136 | }, |
| 1137 | "method-declaration": { |
| 1138 | "name": "meta.method.declaration.js", |
| 1139 | "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*[\\(\\<]))", |
| 1140 | "beginCaptures": { |
| 1141 | "1": { |
| 1142 | "name": "storage.modifier.js" |
| 1143 | }, |
| 1144 | "2": { |
| 1145 | "name": "storage.modifier.js" |
| 1146 | }, |
| 1147 | "3": { |
| 1148 | "name": "storage.modifier.async.js" |
| 1149 | }, |
| 1150 | "4": { |
| 1151 | "name": "storage.type.property.js" |
| 1152 | }, |
| 1153 | "5": { |
| 1154 | "name": "keyword.operator.new.js" |
| 1155 | }, |
| 1156 | "6": { |
| 1157 | "name": "storage.type.js" |
| 1158 | }, |
| 1159 | "7": { |
| 1160 | "name": "keyword.generator.asterisk.js" |
| 1161 | } |
| 1162 | }, |
| 1163 | "end": "(?=\\}|;|,)|(?<=\\})", |
| 1164 | "patterns": [ |
| 1165 | { |
| 1166 | "include": "#method-declaration-name" |
| 1167 | }, |
| 1168 | { |
| 1169 | "include": "#comment" |
| 1170 | }, |
| 1171 | { |
| 1172 | "include": "#type-parameters" |
| 1173 | }, |
| 1174 | { |
| 1175 | "include": "#function-parameters" |
| 1176 | }, |
| 1177 | { |
| 1178 | "include": "#return-type" |
| 1179 | }, |
| 1180 | { |
| 1181 | "include": "#method-overload-declaration" |
| 1182 | }, |
| 1183 | { |
| 1184 | "include": "#decl-block" |
| 1185 | } |
| 1186 | ] |
| 1187 | }, |
| 1188 | "method-overload-declaration": { |
| 1189 | "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*[\\(\\<]))", |
| 1190 | "beginCaptures": { |
| 1191 | "1": { |
| 1192 | "name": "storage.modifier.js" |
| 1193 | }, |
| 1194 | "2": { |
| 1195 | "name": "storage.modifier.js" |
| 1196 | }, |
| 1197 | "3": { |
| 1198 | "name": "storage.modifier.async.js" |
| 1199 | }, |
| 1200 | "4": { |
| 1201 | "name": "storage.type.property.js" |
| 1202 | }, |
| 1203 | "5": { |
| 1204 | "name": "keyword.operator.new.js" |
| 1205 | }, |
| 1206 | "6": { |
| 1207 | "name": "storage.type.js" |
| 1208 | }, |
| 1209 | "7": { |
| 1210 | "name": "keyword.generator.asterisk.js" |
| 1211 | } |
| 1212 | }, |
| 1213 | "end": "(?=\\(|\\<)", |
| 1214 | "patterns": [ |
| 1215 | { |
| 1216 | "include": "#method-declaration-name" |
| 1217 | } |
| 1218 | ] |
| 1219 | }, |
| 1220 | "method-declaration-name": { |
| 1221 | "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\??)\\s*[\\(\\<])", |
| 1222 | "end": "(?=\\(|\\<)", |
| 1223 | "patterns": [ |
| 1224 | { |
| 1225 | "include": "#string" |
| 1226 | }, |
| 1227 | { |
| 1228 | "include": "#array-literal" |
| 1229 | }, |
| 1230 | { |
| 1231 | "name": "entity.name.function.js", |
| 1232 | "match": "[_$[:alpha:]][_$[:alnum:]]*" |
| 1233 | }, |
| 1234 | { |
| 1235 | "name": "keyword.operator.optional.js", |
| 1236 | "match": "\\?" |
| 1237 | } |
| 1238 | ] |
| 1239 | }, |
| 1240 | "indexer-declaration": { |
| 1241 | "name": "meta.indexer.declaration.js", |
| 1242 | "begin": "(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:)", |
| 1243 | "beginCaptures": { |
| 1244 | "1": { |
| 1245 | "name": "storage.modifier.js" |
| 1246 | }, |
| 1247 | "2": { |
| 1248 | "name": "meta.brace.square.js" |
| 1249 | }, |
| 1250 | "3": { |
| 1251 | "name": "variable.parameter.js" |
| 1252 | } |
| 1253 | }, |
| 1254 | "end": "(\\])\\s*(\\?\\s*)?|$", |
| 1255 | "endCaptures": { |
| 1256 | "1": { |
| 1257 | "name": "meta.brace.square.js" |
| 1258 | }, |
| 1259 | "2": { |
| 1260 | "name": "keyword.operator.optional.js" |
| 1261 | } |
| 1262 | }, |
| 1263 | "patterns": [ |
| 1264 | { |
| 1265 | "include": "#type-annotation" |
| 1266 | } |
| 1267 | ] |
| 1268 | }, |
| 1269 | "function-declaration": { |
| 1270 | "name": "meta.function.js", |
| 1271 | "begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*", |
| 1272 | "beginCaptures": { |
| 1273 | "1": { |
| 1274 | "name": "keyword.control.export.js" |
| 1275 | }, |
| 1276 | "2": { |
| 1277 | "name": "storage.modifier.async.js" |
| 1278 | }, |
| 1279 | "3": { |
| 1280 | "name": "storage.type.function.js" |
| 1281 | }, |
| 1282 | "4": { |
| 1283 | "name": "keyword.generator.asterisk.js" |
| 1284 | }, |
| 1285 | "5": { |
| 1286 | "name": "entity.name.function.js" |
| 1287 | } |
| 1288 | }, |
| 1289 | "end": "(?=;|\\})|(?<=\\})", |
| 1290 | "patterns": [ |
| 1291 | { |
| 1292 | "include": "#comment" |
| 1293 | }, |
| 1294 | { |
| 1295 | "include": "#type-parameters" |
| 1296 | }, |
| 1297 | { |
| 1298 | "include": "#function-parameters" |
| 1299 | }, |
| 1300 | { |
| 1301 | "include": "#return-type" |
| 1302 | }, |
| 1303 | { |
| 1304 | "include": "#function-overload-declaration" |
| 1305 | }, |
| 1306 | { |
| 1307 | "include": "#decl-block" |
| 1308 | } |
| 1309 | ] |
| 1310 | }, |
| 1311 | "function-overload-declaration": { |
| 1312 | "name": "meta.function.overload.js", |
| 1313 | "match": "(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*", |
| 1314 | "captures": { |
| 1315 | "1": { |
| 1316 | "name": "keyword.control.export.js" |
| 1317 | }, |
| 1318 | "2": { |
| 1319 | "name": "storage.modifier.async.js" |
| 1320 | }, |
| 1321 | "3": { |
| 1322 | "name": "storage.type.function.js" |
| 1323 | }, |
| 1324 | "4": { |
| 1325 | "name": "keyword.generator.asterisk.js" |
| 1326 | }, |
| 1327 | "5": { |
| 1328 | "name": "entity.name.function.js" |
| 1329 | } |
| 1330 | } |
| 1331 | }, |
| 1332 | "object-literal": { |
| 1333 | "name": "meta.objectliteral.js", |
| 1334 | "begin": "\\{", |
| 1335 | "beginCaptures": { |
| 1336 | "0": { |
| 1337 | "name": "punctuation.definition.block.js" |
| 1338 | } |
| 1339 | }, |
| 1340 | "end": "\\}", |
| 1341 | "endCaptures": { |
| 1342 | "0": { |
| 1343 | "name": "punctuation.definition.block.js" |
| 1344 | } |
| 1345 | }, |
| 1346 | "patterns": [ |
| 1347 | { |
| 1348 | "include": "#object-member" |
| 1349 | } |
| 1350 | ] |
| 1351 | }, |
| 1352 | "decl-block": { |
| 1353 | "name": "meta.block.js", |
| 1354 | "begin": "\\{", |
| 1355 | "beginCaptures": { |
| 1356 | "0": { |
| 1357 | "name": "punctuation.definition.block.js" |
| 1358 | } |
| 1359 | }, |
| 1360 | "end": "\\}", |
| 1361 | "endCaptures": { |
| 1362 | "0": { |
| 1363 | "name": "punctuation.definition.block.js" |
| 1364 | } |
| 1365 | }, |
| 1366 | "patterns": [ |
| 1367 | { |
| 1368 | "include": "#statements" |
| 1369 | } |
| 1370 | ] |
| 1371 | }, |
| 1372 | "after-operator-block": { |
| 1373 | "name": "meta.objectliteral.js", |
| 1374 | "begin": "(?<=[=(,\\[?+!]|await|return|yield|throw|in|of|typeof|&&|\\|\\||\\*)\\s*(\\{)", |
| 1375 | "beginCaptures": { |
| 1376 | "1": { |
| 1377 | "name": "punctuation.definition.block.js" |
| 1378 | } |
| 1379 | }, |
| 1380 | "end": "\\}", |
| 1381 | "endCaptures": { |
| 1382 | "0": { |
| 1383 | "name": "punctuation.definition.block.js" |
| 1384 | } |
| 1385 | }, |
| 1386 | "patterns": [ |
| 1387 | { |
| 1388 | "include": "#object-member" |
| 1389 | } |
| 1390 | ] |
| 1391 | }, |
| 1392 | "parameter-name": { |
| 1393 | "patterns": [ |
| 1394 | { |
| 1395 | "match": "(?x)(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s* (=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) | ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)) ) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ))) ))", |
| 1396 | "captures": { |
| 1397 | "1": { |
| 1398 | "name": "storage.modifier.js" |
| 1399 | }, |
| 1400 | "2": { |
| 1401 | "name": "storage.modifier.js" |
| 1402 | }, |
| 1403 | "3": { |
| 1404 | "name": "keyword.operator.rest.js" |
| 1405 | }, |
| 1406 | "4": { |
| 1407 | "name": "entity.name.function.js" |
| 1408 | }, |
| 1409 | "5": { |
| 1410 | "name": "keyword.operator.optional.js" |
| 1411 | } |
| 1412 | } |
| 1413 | }, |
| 1414 | { |
| 1415 | "match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)", |
| 1416 | "captures": { |
| 1417 | "1": { |
| 1418 | "name": "storage.modifier.js" |
| 1419 | }, |
| 1420 | "2": { |
| 1421 | "name": "storage.modifier.js" |
| 1422 | }, |
| 1423 | "3": { |
| 1424 | "name": "keyword.operator.rest.js" |
| 1425 | }, |
| 1426 | "4": { |
| 1427 | "name": "variable.parameter.js" |
| 1428 | }, |
| 1429 | "5": { |
| 1430 | "name": "keyword.operator.optional.js" |
| 1431 | } |
| 1432 | } |
| 1433 | } |
| 1434 | ] |
| 1435 | }, |
| 1436 | "destructuring-parameter": { |
| 1437 | "patterns": [ |
| 1438 | { |
| 1439 | "name": "meta.parameter.object-binding-pattern.js", |
| 1440 | "begin": "(?<!=|:)\\s*(\\{)", |
| 1441 | "beginCaptures": { |
| 1442 | "1": { |
| 1443 | "name": "punctuation.definition.binding-pattern.object.js" |
| 1444 | } |
| 1445 | }, |
| 1446 | "end": "\\}", |
| 1447 | "endCaptures": { |
| 1448 | "0": { |
| 1449 | "name": "punctuation.definition.binding-pattern.object.js" |
| 1450 | } |
| 1451 | }, |
| 1452 | "patterns": [ |
| 1453 | { |
| 1454 | "include": "#parameter-object-binding-element" |
| 1455 | } |
| 1456 | ] |
| 1457 | }, |
| 1458 | { |
| 1459 | "name": "meta.paramter.array-binding-pattern.js", |
| 1460 | "begin": "(?<!=|:)\\s*(\\[)", |
| 1461 | "beginCaptures": { |
| 1462 | "1": { |
| 1463 | "name": "punctuation.definition.binding-pattern.array.js" |
| 1464 | } |
| 1465 | }, |
| 1466 | "end": "\\]", |
| 1467 | "endCaptures": { |
| 1468 | "0": { |
| 1469 | "name": "punctuation.definition.binding-pattern.array.js" |
| 1470 | } |
| 1471 | }, |
| 1472 | "patterns": [ |
| 1473 | { |
| 1474 | "include": "#parameter-binding-element" |
| 1475 | }, |
| 1476 | { |
| 1477 | "include": "#punctuation-comma" |
| 1478 | } |
| 1479 | ] |
| 1480 | } |
| 1481 | ] |
| 1482 | }, |
| 1483 | "parameter-object-binding-element": { |
| 1484 | "patterns": [ |
| 1485 | { |
| 1486 | "include": "#comment" |
| 1487 | }, |
| 1488 | { |
| 1489 | "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))", |
| 1490 | "end": "(?=,|\\})", |
| 1491 | "patterns": [ |
| 1492 | { |
| 1493 | "include": "#object-binding-element-propertyName" |
| 1494 | }, |
| 1495 | { |
| 1496 | "include": "#parameter-binding-element" |
| 1497 | } |
| 1498 | ] |
| 1499 | }, |
| 1500 | { |
| 1501 | "include": "#parameter-object-binding-pattern" |
| 1502 | }, |
| 1503 | { |
| 1504 | "include": "#destructuring-parameter-rest" |
| 1505 | }, |
| 1506 | { |
| 1507 | "include": "#variable-initializer" |
| 1508 | }, |
| 1509 | { |
| 1510 | "include": "#punctuation-comma" |
| 1511 | } |
| 1512 | ] |
| 1513 | }, |
| 1514 | "parameter-binding-element": { |
| 1515 | "patterns": [ |
| 1516 | { |
| 1517 | "include": "#comment" |
| 1518 | }, |
| 1519 | { |
| 1520 | "include": "#parameter-object-binding-pattern" |
| 1521 | }, |
| 1522 | { |
| 1523 | "include": "#parameter-array-binding-pattern" |
| 1524 | }, |
| 1525 | { |
| 1526 | "include": "#destructuring-parameter-rest" |
| 1527 | }, |
| 1528 | { |
| 1529 | "include": "#variable-initializer" |
| 1530 | } |
| 1531 | ] |
| 1532 | }, |
| 1533 | "destructuring-parameter-rest": { |
| 1534 | "match": "(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)", |
| 1535 | "captures": { |
| 1536 | "1": { |
| 1537 | "name": "keyword.operator.rest.js" |
| 1538 | }, |
| 1539 | "2": { |
| 1540 | "name": "variable.parameter.js" |
| 1541 | } |
| 1542 | } |
| 1543 | }, |
| 1544 | "parameter-object-binding-pattern": { |
| 1545 | "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)", |
| 1546 | "beginCaptures": { |
| 1547 | "1": { |
| 1548 | "name": "keyword.operator.rest.js" |
| 1549 | }, |
| 1550 | "2": { |
| 1551 | "name": "punctuation.definition.binding-pattern.object.js" |
| 1552 | } |
| 1553 | }, |
| 1554 | "end": "\\}", |
| 1555 | "endCaptures": { |
| 1556 | "0": { |
| 1557 | "name": "punctuation.definition.binding-pattern.object.js" |
| 1558 | } |
| 1559 | }, |
| 1560 | "patterns": [ |
| 1561 | { |
| 1562 | "include": "#parameter-object-binding-element" |
| 1563 | } |
| 1564 | ] |
| 1565 | }, |
| 1566 | "parameter-array-binding-pattern": { |
| 1567 | "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", |
| 1568 | "beginCaptures": { |
| 1569 | "1": { |
| 1570 | "name": "keyword.operator.rest.js" |
| 1571 | }, |
| 1572 | "2": { |
| 1573 | "name": "punctuation.definition.binding-pattern.array.js" |
| 1574 | } |
| 1575 | }, |
| 1576 | "end": "\\]", |
| 1577 | "endCaptures": { |
| 1578 | "0": { |
| 1579 | "name": "punctuation.definition.binding-pattern.array.js" |
| 1580 | } |
| 1581 | }, |
| 1582 | "patterns": [ |
| 1583 | { |
| 1584 | "include": "#parameter-binding-element" |
| 1585 | }, |
| 1586 | { |
| 1587 | "include": "#punctuation-comma" |
| 1588 | } |
| 1589 | ] |
| 1590 | }, |
| 1591 | "return-type": { |
| 1592 | "name": "meta.return.type.js", |
| 1593 | "begin": "(?<=\\))\\s*(:)", |
| 1594 | "beginCaptures": { |
| 1595 | "1": { |
| 1596 | "name": "keyword.operator.type.annotation.js" |
| 1597 | } |
| 1598 | }, |
| 1599 | "end": "(?<!:)((?=$)|(?=\\{|;|//|\\}))", |
| 1600 | "patterns": [ |
| 1601 | { |
| 1602 | "include": "#comment" |
| 1603 | }, |
| 1604 | { |
| 1605 | "name": "meta.object.type.js", |
| 1606 | "begin": "(?<=:)\\s*(\\{)", |
| 1607 | "beginCaptures": { |
| 1608 | "1": { |
| 1609 | "name": "punctuation.definition.block.js" |
| 1610 | } |
| 1611 | }, |
| 1612 | "end": "\\}", |
| 1613 | "endCaptures": { |
| 1614 | "0": { |
| 1615 | "name": "punctuation.definition.block.js" |
| 1616 | } |
| 1617 | }, |
| 1618 | "patterns": [ |
| 1619 | { |
| 1620 | "include": "#type-object-members" |
| 1621 | } |
| 1622 | ] |
| 1623 | }, |
| 1624 | { |
| 1625 | "include": "#type-predicate-operator" |
| 1626 | }, |
| 1627 | { |
| 1628 | "include": "#type" |
| 1629 | } |
| 1630 | ] |
| 1631 | }, |
| 1632 | "type-predicate-operator": { |
| 1633 | "name": "keyword.operator.expression.is.js", |
| 1634 | "match": "(?<!\\.|\\$)\\bis\\b(?!\\$)" |
| 1635 | }, |
| 1636 | "type-annotation": { |
| 1637 | "name": "meta.type.annotation.js", |
| 1638 | "begin": ":", |
| 1639 | "beginCaptures": { |
| 1640 | "0": { |
| 1641 | "name": "keyword.operator.type.annotation.js" |
| 1642 | } |
| 1643 | }, |
| 1644 | "end": "(?=$|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", |
| 1645 | "patterns": [ |
| 1646 | { |
| 1647 | "include": "#comment" |
| 1648 | }, |
| 1649 | { |
| 1650 | "include": "#type" |
| 1651 | } |
| 1652 | ] |
| 1653 | }, |
| 1654 | "type": { |
| 1655 | "name": "meta.type.js", |
| 1656 | "patterns": [ |
| 1657 | { |
| 1658 | "include": "#comment" |
| 1659 | }, |
| 1660 | { |
| 1661 | "include": "#string" |
| 1662 | }, |
| 1663 | { |
| 1664 | "include": "#numeric-literal" |
| 1665 | }, |
| 1666 | { |
| 1667 | "include": "#type-primitive" |
| 1668 | }, |
| 1669 | { |
| 1670 | "include": "#type-builtin-literals" |
| 1671 | }, |
| 1672 | { |
| 1673 | "include": "#type-parameters" |
| 1674 | }, |
| 1675 | { |
| 1676 | "include": "#type-tuple" |
| 1677 | }, |
| 1678 | { |
| 1679 | "include": "#type-object" |
| 1680 | }, |
| 1681 | { |
| 1682 | "include": "#type-operators" |
| 1683 | }, |
| 1684 | { |
| 1685 | "include": "#type-fn-type-parameters" |
| 1686 | }, |
| 1687 | { |
| 1688 | "include": "#type-paren-or-function-parameters" |
| 1689 | }, |
| 1690 | { |
| 1691 | "include": "#type-function-return-type" |
| 1692 | }, |
| 1693 | { |
| 1694 | "include": "#type-name" |
| 1695 | } |
| 1696 | ] |
| 1697 | }, |
| 1698 | "function-parameters": { |
| 1699 | "name": "meta.parameters.js", |
| 1700 | "begin": "\\(", |
| 1701 | "beginCaptures": { |
| 1702 | "0": { |
| 1703 | "name": "punctuation.definition.parameters.begin.js" |
| 1704 | } |
| 1705 | }, |
| 1706 | "end": "\\)", |
| 1707 | "endCaptures": { |
| 1708 | "0": { |
| 1709 | "name": "punctuation.definition.parameters.end.js" |
| 1710 | } |
| 1711 | }, |
| 1712 | "patterns": [ |
| 1713 | { |
| 1714 | "include": "#comment" |
| 1715 | }, |
| 1716 | { |
| 1717 | "include": "#decorator" |
| 1718 | }, |
| 1719 | { |
| 1720 | "include": "#destructuring-parameter" |
| 1721 | }, |
| 1722 | { |
| 1723 | "include": "#parameter-name" |
| 1724 | }, |
| 1725 | { |
| 1726 | "include": "#type-annotation" |
| 1727 | }, |
| 1728 | { |
| 1729 | "include": "#variable-initializer" |
| 1730 | }, |
| 1731 | { |
| 1732 | "name": "punctuation.separator.parameter.js", |
| 1733 | "match": "," |
| 1734 | } |
| 1735 | ] |
| 1736 | }, |
| 1737 | "type-primitive": { |
| 1738 | "name": "support.type.primitive.js", |
| 1739 | "match": "(?<!\\.|\\$)\\b(string|number|boolean|symbol|any|void|never)\\b(?!\\$)" |
| 1740 | }, |
| 1741 | "type-builtin-literals": { |
| 1742 | "name": "support.type.builtin.js", |
| 1743 | "match": "(?<!\\.|\\$)\\b(this|true|false|undefined|null)\\b(?!\\$)" |
| 1744 | }, |
| 1745 | "type-paren-or-function-parameters": { |
| 1746 | "name": "meta.type.paren.cover.js", |
| 1747 | "begin": "\\(", |
| 1748 | "beginCaptures": { |
| 1749 | "0": { |
| 1750 | "name": "meta.brace.round.js" |
| 1751 | } |
| 1752 | }, |
| 1753 | "end": "\\)", |
| 1754 | "endCaptures": { |
| 1755 | "0": { |
| 1756 | "name": "meta.brace.round.js" |
| 1757 | } |
| 1758 | }, |
| 1759 | "patterns": [ |
| 1760 | { |
| 1761 | "include": "#type" |
| 1762 | }, |
| 1763 | { |
| 1764 | "include": "#function-parameters" |
| 1765 | } |
| 1766 | ] |
| 1767 | }, |
| 1768 | "type-fn-type-parameters": { |
| 1769 | "patterns": [ |
| 1770 | { |
| 1771 | "name": "meta.type.constructor.js", |
| 1772 | "match": "(?<!\\.|\\$)\\b(new)\\b(?=\\s*\\<)", |
| 1773 | "captures": { |
| 1774 | "1": { |
| 1775 | "name": "keyword.control.new.js" |
| 1776 | } |
| 1777 | } |
| 1778 | }, |
| 1779 | { |
| 1780 | "name": "meta.type.constructor.js", |
| 1781 | "begin": "(?<!\\.|\\$)\\b(new)\\b\\s*(?=\\()", |
| 1782 | "beginCaptures": { |
| 1783 | "1": { |
| 1784 | "name": "keyword.control.new.js" |
| 1785 | } |
| 1786 | }, |
| 1787 | "end": "(?<=\\))", |
| 1788 | "patterns": [ |
| 1789 | { |
| 1790 | "include": "#function-parameters" |
| 1791 | } |
| 1792 | ] |
| 1793 | }, |
| 1794 | { |
| 1795 | "name": "meta.type.function.js", |
| 1796 | "begin": "(?<=\\>)\\s*(?=\\()", |
| 1797 | "end": "(?<=\\))", |
| 1798 | "patterns": [ |
| 1799 | { |
| 1800 | "include": "#function-parameters" |
| 1801 | } |
| 1802 | ] |
| 1803 | }, |
| 1804 | { |
| 1805 | "name": "meta.type.function.js", |
| 1806 | "begin": "(?x)( (?= [(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )", |
| 1807 | "end": "(?<=\\))", |
| 1808 | "patterns": [ |
| 1809 | { |
| 1810 | "include": "#function-parameters" |
| 1811 | } |
| 1812 | ] |
| 1813 | } |
| 1814 | ] |
| 1815 | }, |
| 1816 | "type-operators": { |
| 1817 | "patterns": [ |
| 1818 | { |
| 1819 | "include": "#typeof-operator" |
| 1820 | }, |
| 1821 | { |
| 1822 | "name": "keyword.operator.type.js", |
| 1823 | "match": "[&|]" |
| 1824 | }, |
| 1825 | { |
| 1826 | "name": "keyword.operator.expression.keyof.js", |
| 1827 | "match": "(?<!\\.|\\$)\\bkeyof\\b(?!\\$)" |
| 1828 | } |
| 1829 | ] |
| 1830 | }, |
| 1831 | "type-function-return-type": { |
| 1832 | "name": "meta.type.function.return.js", |
| 1833 | "begin": "=>", |
| 1834 | "beginCaptures": { |
| 1835 | "0": { |
| 1836 | "name": "storage.type.function.arrow.js" |
| 1837 | } |
| 1838 | }, |
| 1839 | "end": "(?<!=>)(?=[,\\]\\)\\{\\}=;>]|//|$)", |
| 1840 | "patterns": [ |
| 1841 | { |
| 1842 | "include": "#comment" |
| 1843 | }, |
| 1844 | { |
| 1845 | "name": "meta.object.type.js", |
| 1846 | "begin": "(?<==>)\\s*(\\{)", |
| 1847 | "beginCaptures": { |
| 1848 | "1": { |
| 1849 | "name": "punctuation.definition.block.js" |
| 1850 | } |
| 1851 | }, |
| 1852 | "end": "\\}", |
| 1853 | "endCaptures": { |
| 1854 | "0": { |
| 1855 | "name": "punctuation.definition.block.js" |
| 1856 | } |
| 1857 | }, |
| 1858 | "patterns": [ |
| 1859 | { |
| 1860 | "include": "#type-object-members" |
| 1861 | } |
| 1862 | ] |
| 1863 | }, |
| 1864 | { |
| 1865 | "include": "#type-predicate-operator" |
| 1866 | }, |
| 1867 | { |
| 1868 | "include": "#type" |
| 1869 | } |
| 1870 | ] |
| 1871 | }, |
| 1872 | "type-tuple": { |
| 1873 | "name": "meta.type.tuple.js", |
| 1874 | "begin": "\\[", |
| 1875 | "beginCaptures": { |
| 1876 | "0": { |
| 1877 | "name": "meta.brace.square.js" |
| 1878 | } |
| 1879 | }, |
| 1880 | "end": "\\]", |
| 1881 | "endCaptures": { |
| 1882 | "0": { |
| 1883 | "name": "meta.brace.square.js" |
| 1884 | } |
| 1885 | }, |
| 1886 | "patterns": [ |
| 1887 | { |
| 1888 | "include": "#type" |
| 1889 | }, |
| 1890 | { |
| 1891 | "include": "#punctuation-comma" |
| 1892 | } |
| 1893 | ] |
| 1894 | }, |
| 1895 | "type-name": { |
| 1896 | "patterns": [ |
| 1897 | { |
| 1898 | "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)", |
| 1899 | "captures": { |
| 1900 | "1": { |
| 1901 | "name": "entity.name.type.module.js" |
| 1902 | }, |
| 1903 | "2": { |
| 1904 | "name": "punctuation.accessor.js" |
| 1905 | } |
| 1906 | } |
| 1907 | }, |
| 1908 | { |
| 1909 | "name": "entity.name.type.js", |
| 1910 | "match": "[_$[:alpha:]][_$[:alnum:]]*" |
| 1911 | } |
| 1912 | ] |
| 1913 | }, |
| 1914 | "type-parameters": { |
| 1915 | "name": "meta.type.parameters.js", |
| 1916 | "begin": "(<)", |
| 1917 | "beginCaptures": { |
| 1918 | "1": { |
| 1919 | "name": "punctuation.definition.typeparameters.begin.js" |
| 1920 | } |
| 1921 | }, |
| 1922 | "end": "(?=$)|(>)", |
| 1923 | "endCaptures": { |
| 1924 | "1": { |
| 1925 | "name": "punctuation.definition.typeparameters.end.js" |
| 1926 | } |
| 1927 | }, |
| 1928 | "patterns": [ |
| 1929 | { |
| 1930 | "include": "#comment" |
| 1931 | }, |
| 1932 | { |
| 1933 | "name": "storage.modifier.js", |
| 1934 | "match": "(?<!\\.|\\$)\\b(extends)\\b(?!\\$)" |
| 1935 | }, |
| 1936 | { |
| 1937 | "include": "#type" |
| 1938 | }, |
| 1939 | { |
| 1940 | "include": "#punctuation-comma" |
| 1941 | } |
| 1942 | ] |
| 1943 | }, |
| 1944 | "variable-initializer": { |
| 1945 | "begin": "(?<!=|!)(=)(?!=)", |
| 1946 | "beginCaptures": { |
| 1947 | "1": { |
| 1948 | "name": "keyword.operator.assignment.js" |
| 1949 | } |
| 1950 | }, |
| 1951 | "end": "(?=$|[,);}\\]])", |
| 1952 | "patterns": [ |
| 1953 | { |
| 1954 | "include": "#expression" |
| 1955 | } |
| 1956 | ] |
| 1957 | }, |
| 1958 | "for-loop": { |
| 1959 | "begin": "(?<!\\.|\\$)\\b(for)\\s*(\\()", |
| 1960 | "beginCaptures": { |
| 1961 | "1": { |
| 1962 | "name": "keyword.control.loop.js" |
| 1963 | }, |
| 1964 | "2": { |
| 1965 | "name": "meta.brace.round.js" |
| 1966 | } |
| 1967 | }, |
| 1968 | "end": "\\)", |
| 1969 | "endCaptures": { |
| 1970 | "0": { |
| 1971 | "name": "meta.brace.round.js" |
| 1972 | } |
| 1973 | }, |
| 1974 | "patterns": [ |
| 1975 | { |
| 1976 | "include": "#var-expr" |
| 1977 | }, |
| 1978 | { |
| 1979 | "include": "#expression" |
| 1980 | }, |
| 1981 | { |
| 1982 | "include": "#punctuation-semicolon" |
| 1983 | } |
| 1984 | ] |
| 1985 | }, |
| 1986 | "switch-expression": { |
| 1987 | "name": "switch-expression.expr.js", |
| 1988 | "begin": "(?<!\\.|\\$)\\b(switch)\\s*(\\()", |
| 1989 | "beginCaptures": { |
| 1990 | "1": { |
| 1991 | "name": "keyword.control.switch.js" |
| 1992 | }, |
| 1993 | "2": { |
| 1994 | "name": "meta.brace.round.js" |
| 1995 | } |
| 1996 | }, |
| 1997 | "end": "\\)", |
| 1998 | "endCaptures": { |
| 1999 | "0": { |
| 2000 | "name": "meta.brace.round.js" |
| 2001 | } |
| 2002 | }, |
| 2003 | "patterns": [ |
| 2004 | { |
| 2005 | "include": "#expression" |
| 2006 | } |
| 2007 | ] |
| 2008 | }, |
| 2009 | "switch-block": { |
| 2010 | "name": "switch-block.expr.js", |
| 2011 | "begin": "{", |
| 2012 | "beginCaptures": { |
| 2013 | "0": { |
| 2014 | "name": "punctuation.definition.block.js" |
| 2015 | } |
| 2016 | }, |
| 2017 | "end": "(?=\\})", |
| 2018 | "patterns": [ |
| 2019 | { |
| 2020 | "include": "#case-clause" |
| 2021 | }, |
| 2022 | { |
| 2023 | "include": "#statements" |
| 2024 | } |
| 2025 | ] |
| 2026 | }, |
| 2027 | "case-clause": { |
| 2028 | "name": "case-clause.expr.js", |
| 2029 | "begin": "(?<!\\.|\\$)\\b(case|default(?=:))\\b(?!\\$)", |
| 2030 | "beginCaptures": { |
| 2031 | "1": { |
| 2032 | "name": "keyword.control.switch.js" |
| 2033 | } |
| 2034 | }, |
| 2035 | "end": ":", |
| 2036 | "endCaptures": { |
| 2037 | "0": { |
| 2038 | "name": "punctuation.definition.section.case-statement.js" |
| 2039 | } |
| 2040 | }, |
| 2041 | "patterns": [ |
| 2042 | { |
| 2043 | "include": "#expression" |
| 2044 | } |
| 2045 | ] |
| 2046 | }, |
| 2047 | "switch-statement": { |
| 2048 | "name": "switch-statement.expr.js", |
| 2049 | "begin": "(?<!\\.|\\$)(?=\\bswitch\\s*\\()", |
| 2050 | "end": "}", |
| 2051 | "endCaptures": { |
| 2052 | "0": { |
| 2053 | "name": "punctuation.definition.block.js" |
| 2054 | } |
| 2055 | }, |
| 2056 | "patterns": [ |
| 2057 | { |
| 2058 | "include": "#switch-expression" |
| 2059 | }, |
| 2060 | { |
| 2061 | "include": "#switch-block" |
| 2062 | } |
| 2063 | ] |
| 2064 | }, |
| 2065 | "support-objects": { |
| 2066 | "patterns": [ |
| 2067 | { |
| 2068 | "name": "variable.language.arguments.js", |
| 2069 | "match": "(?<!\\.|\\$)\\b(arguments)\\b(?!\\$)" |
| 2070 | }, |
| 2071 | { |
| 2072 | "name": "support.class.builtin.js", |
| 2073 | "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(?!\\$)" |
| 2074 | }, |
| 2075 | { |
| 2076 | "name": "support.class.error.js", |
| 2077 | "match": "(?<!\\.|\\$)\\b((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\\b(?!\\$)" |
| 2078 | }, |
| 2079 | { |
| 2080 | "name": "support.function.js", |
| 2081 | "match": "(?x)(?<!\\.|\\$)\\b(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval| isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\\s*\\()" |
| 2082 | }, |
| 2083 | { |
| 2084 | "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(?!\\$)", |
| 2085 | "captures": { |
| 2086 | "1": { |
| 2087 | "name": "support.constant.math.js" |
| 2088 | }, |
| 2089 | "2": { |
| 2090 | "name": "punctuation.accessor.js" |
| 2091 | }, |
| 2092 | "3": { |
| 2093 | "name": "support.function.math.js" |
| 2094 | }, |
| 2095 | "4": { |
| 2096 | "name": "support.constant.property.math.js" |
| 2097 | } |
| 2098 | } |
| 2099 | }, |
| 2100 | { |
| 2101 | "match": "(?x)(?<!\\.|\\$)\\b(console)(?:\\s*(\\.)\\s*(\n assert|clear|count|debug|dir|error|group|groupCollapsed|groupEnd|info|log\n |profile|profileEnd|table|time|timeEnd|timeStamp|trace|warn))?\\b(?!\\$)", |
| 2102 | "captures": { |
| 2103 | "1": { |
| 2104 | "name": "support.class.console.js" |
| 2105 | }, |
| 2106 | "2": { |
| 2107 | "name": "punctuation.accessor.js" |
| 2108 | }, |
| 2109 | "3": { |
| 2110 | "name": "support.function.console.js" |
| 2111 | } |
| 2112 | } |
| 2113 | }, |
| 2114 | { |
| 2115 | "match": "(?<!\\.|\\$)\\b(JSON)(?:\\s*(\\.)\\s*(parse|stringify))?\\b(?!\\$)", |
| 2116 | "captures": { |
| 2117 | "1": { |
| 2118 | "name": "support.constant.json.js" |
| 2119 | }, |
| 2120 | "2": { |
| 2121 | "name": "punctuation.accessor.js" |
| 2122 | }, |
| 2123 | "3": { |
| 2124 | "name": "support.function.json.js" |
| 2125 | } |
| 2126 | } |
| 2127 | }, |
| 2128 | { |
| 2129 | "match": "(?x) (\\.) \\s* (?:\n (constructor|length|prototype|__proto__) \n |\n (EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY))\\b(?!\\$)", |
| 2130 | "captures": { |
| 2131 | "1": { |
| 2132 | "name": "punctuation.accessor.js" |
| 2133 | }, |
| 2134 | "2": { |
| 2135 | "name": "support.variable.property.js" |
| 2136 | }, |
| 2137 | "3": { |
| 2138 | "name": "support.constant.js" |
| 2139 | } |
| 2140 | } |
| 2141 | }, |
| 2142 | { |
| 2143 | "match": "(?x) (?<!\\.|\\$) \\b (?:\n (document|event|navigator|performance|screen|window) \n |\n (AnalyserNode|ArrayBufferView|Attr|AudioBuffer|AudioBufferSourceNode|AudioContext|AudioDestinationNode|AudioListener\n |AudioNode|AudioParam|BatteryManager|BeforeUnloadEvent|BiquadFilterNode|Blob|BufferSource|ByteString|CSS|CSSConditionRule\n |CSSCounterStyleRule|CSSGroupingRule|CSSMatrix|CSSMediaRule|CSSPageRule|CSSPrimitiveValue|CSSRule|CSSRuleList|CSSStyleDeclaration\n |CSSStyleRule|CSSStyleSheet|CSSSupportsRule|CSSValue|CSSValueList|CanvasGradient|CanvasImageSource|CanvasPattern\n |CanvasRenderingContext2D|ChannelMergerNode|ChannelSplitterNode|CharacterData|ChromeWorker|CloseEvent|Comment|CompositionEvent\n |Console|ConvolverNode|Coordinates|Credential|CredentialsContainer|Crypto|CryptoKey|CustomEvent|DOMError|DOMException\n |DOMHighResTimeStamp|DOMImplementation|DOMString|DOMStringList|DOMStringMap|DOMTimeStamp|DOMTokenList|DataTransfer\n |DataTransferItem|DataTransferItemList|DedicatedWorkerGlobalScope|DelayNode|DeviceProximityEvent|DirectoryEntry\n |DirectoryEntrySync|DirectoryReader|DirectoryReaderSync|Document|DocumentFragment|DocumentTouch|DocumentType|DragEvent\n |DynamicsCompressorNode|Element|Entry|EntrySync|ErrorEvent|Event|EventListener|EventSource|EventTarget|FederatedCredential\n |FetchEvent|File|FileEntry|FileEntrySync|FileException|FileList|FileReader|FileReaderSync|FileSystem|FileSystemSync\n |FontFace|FormData|GainNode|Gamepad|GamepadButton|GamepadEvent|Geolocation|GlobalEventHandlers|HTMLAnchorElement\n |HTMLAreaElement|HTMLAudioElement|HTMLBRElement|HTMLBaseElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement\n |HTMLCollection|HTMLContentElement|HTMLDListElement|HTMLDataElement|HTMLDataListElement|HTMLDialogElement|HTMLDivElement\n |HTMLDocument|HTMLElement|HTMLEmbedElement|HTMLFieldSetElement|HTMLFontElement|HTMLFormControlsCollection|HTMLFormElement\n |HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLInputElement\n |HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMediaElement\n |HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOptGroupElement|HTMLOptionElement\n |HTMLOptionsCollection|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement\n |HTMLQuoteElement|HTMLScriptElement|HTMLSelectElement|HTMLShadowElement|HTMLSourceElement|HTMLSpanElement|HTMLStyleElement\n |HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement\n |HTMLTableRowElement|HTMLTableSectionElement|HTMLTextAreaElement|HTMLTimeElement|HTMLTitleElement|HTMLTrackElement\n |HTMLUListElement|HTMLUnknownElement|HTMLVideoElement|HashChangeEvent|History|IDBCursor|IDBCursorWithValue|IDBDatabase\n |IDBEnvironment|IDBFactory|IDBIndex|IDBKeyRange|IDBMutableFile|IDBObjectStore|IDBOpenDBRequest|IDBRequest|IDBTransaction\n |IDBVersionChangeEvent|IIRFilterNode|IdentityManager|ImageBitmap|ImageBitmapFactories|ImageData|Index|InputDeviceCapabilities\n |InputEvent|InstallEvent|InstallTrigger|KeyboardEvent|LinkStyle|LocalFileSystem|LocalFileSystemSync|Location|MIDIAccess\n |MIDIConnectionEvent|MIDIInput|MIDIInputMap|MIDIOutputMap|MediaElementAudioSourceNode|MediaError|MediaKeyMessageEvent\n |MediaKeySession|MediaKeyStatusMap|MediaKeySystemAccess|MediaKeySystemConfiguration|MediaKeys|MediaRecorder|MediaStream\n |MediaStreamAudioDestinationNode|MediaStreamAudioSourceNode|MessageChannel|MessageEvent|MessagePort|MouseEvent\n |MutationObserver|MutationRecord|NamedNodeMap|Navigator|NavigatorConcurrentHardware|NavigatorGeolocation|NavigatorID\n |NavigatorLanguage|NavigatorOnLine|Node|NodeFilter|NodeIterator|NodeList|NonDocumentTypeChildNode|Notification\n |OfflineAudioCompletionEvent|OfflineAudioContext|OscillatorNode|PageTransitionEvent|PannerNode|ParentNode|PasswordCredential\n |Path2D|PaymentAddress|PaymentRequest|PaymentResponse|Performance|PerformanceEntry|PerformanceFrameTiming|PerformanceMark\n |PerformanceMeasure|PerformanceNavigation|PerformanceNavigationTiming|PerformanceObserver|PerformanceObserverEntryList\n |PerformanceResourceTiming|PerformanceTiming|PeriodicSyncEvent|PeriodicWave|Plugin|Point|PointerEvent|PopStateEvent\n |PortCollection|Position|PositionError|PositionOptions|PresentationConnectionClosedEvent|PresentationConnectionList\n |PresentationReceiver|ProcessingInstruction|ProgressEvent|PromiseRejectionEvent|PushEvent|PushRegistrationManager\n |RTCCertificate|RTCConfiguration|RTCPeerConnection|RTCSessionDescriptionCallback|RTCStatsReport|RadioNodeList|RandomSource\n |Range|ReadableByteStream|RenderingContext|SVGAElement|SVGAngle|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement\n |SVGAnimateTransformElement|SVGAnimatedAngle|SVGAnimatedBoolean|SVGAnimatedEnumeration|SVGAnimatedInteger|SVGAnimatedLength\n |SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList|SVGAnimatedPoints|SVGAnimatedPreserveAspectRatio\n |SVGAnimatedRect|SVGAnimatedString|SVGAnimatedTransformList|SVGAnimationElement|SVGCircleElement|SVGClipPathElement\n |SVGCursorElement|SVGDefsElement|SVGDescElement|SVGElement|SVGEllipseElement|SVGEvent|SVGFilterElement|SVGFontElement\n |SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement\n |SVGForeignObjectElement|SVGGElement|SVGGlyphElement|SVGGradientElement|SVGHKernElement|SVGImageElement|SVGLength\n |SVGLengthList|SVGLineElement|SVGLinearGradientElement|SVGMPathElement|SVGMaskElement|SVGMatrix|SVGMissingGlyphElement\n |SVGNumber|SVGNumberList|SVGPathElement|SVGPatternElement|SVGPoint|SVGPolygonElement|SVGPolylineElement|SVGPreserveAspectRatio\n |SVGRadialGradientElement|SVGRect|SVGRectElement|SVGSVGElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStringList\n |SVGStylable|SVGStyleElement|SVGSwitchElement|SVGSymbolElement|SVGTRefElement|SVGTSpanElement|SVGTests|SVGTextElement\n |SVGTextPositioningElement|SVGTitleElement|SVGTransform|SVGTransformList|SVGTransformable|SVGUseElement|SVGVKernElement\n |SVGViewElement|ServiceWorker|ServiceWorkerContainer|ServiceWorkerGlobalScope|ServiceWorkerRegistration|ServiceWorkerState\n |ShadowRoot|SharedWorker|SharedWorkerGlobalScope|SourceBufferList|StereoPannerNode|Storage|StorageEvent|StyleSheet\n |StyleSheetList|SubtleCrypto|SyncEvent|Text|TextMetrics|TimeEvent|TimeRanges|Touch|TouchEvent|TouchList|Transferable\n |TreeWalker|UIEvent|USVString|VRDisplayCapabilities|ValidityState|WaveShaperNode|WebGL|WebGLActiveInfo|WebGLBuffer\n |WebGLContextEvent|WebGLFramebuffer|WebGLProgram|WebGLRenderbuffer|WebGLRenderingContext|WebGLShader|WebGLShaderPrecisionFormat\n |WebGLTexture|WebGLTimerQueryEXT|WebGLTransformFeedback|WebGLUniformLocation|WebGLVertexArrayObject|WebGLVertexArrayObjectOES\n |WebSocket|WebSockets|WebVTT|WheelEvent|Window|WindowBase64|WindowEventHandlers|WindowTimers|Worker|WorkerGlobalScope\n |WorkerLocation|WorkerNavigator|XMLHttpRequest|XMLHttpRequestEventTarget|XMLSerializer|XPathExpression|XPathResult\n |XSLTProcessor))\\b(?!\\$)", |
| 2144 | "captures": { |
| 2145 | "1": { |
| 2146 | "name": "support.variable.dom.js" |
| 2147 | }, |
| 2148 | "2": { |
| 2149 | "name": "support.class.dom.js" |
| 2150 | } |
| 2151 | } |
| 2152 | }, |
| 2153 | { |
| 2154 | "match": "(?x) (\\.) \\s* (?:\n (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n |\n (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName\n |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop\n |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor\n |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption\n |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear\n |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete\n |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset\n |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight\n |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds\n |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize\n |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host\n |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth\n |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext\n |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom\n |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple\n |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName\n |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight\n |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer\n |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling\n |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText\n |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts\n |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove\n |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary\n |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead\n |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile\n |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\\b(?!\\$|\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()", |
| 2155 | "captures": { |
| 2156 | "1": { |
| 2157 | "name": "punctuation.accessor.js" |
| 2158 | }, |
| 2159 | "2": { |
| 2160 | "name": "support.constant.dom.js" |
| 2161 | }, |
| 2162 | "3": { |
| 2163 | "name": "support.variable.property.dom.js" |
| 2164 | } |
| 2165 | } |
| 2166 | }, |
| 2167 | { |
| 2168 | "name": "support.class.node.js", |
| 2169 | "match": "(?x)(?<!\\.|\\$)\\b(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream\n |Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\\b(?!\\$)" |
| 2170 | }, |
| 2171 | { |
| 2172 | "name": "support.module.node.js", |
| 2173 | "match": "(?x)(?<!\\.|\\$)\\b(assert|buffer|child_process|cluster|constants|crypto|dgram|dns|domain|events|fs|http|https|net\n |os|path|punycode|querystring|readline|repl|stream|string_decoder|timers|tls|tty|url|util|vm|zlib)\\b(?!\\$)" |
| 2174 | }, |
| 2175 | { |
| 2176 | "match": "(?x)(?<!\\.|\\$)\\b(process)(?:(\\.)(?:\n (arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)\n |\n (abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)\n))?\\b(?!\\$)", |
| 2177 | "captures": { |
| 2178 | "1": { |
| 2179 | "name": "support.variable.object.process.js" |
| 2180 | }, |
| 2181 | "2": { |
| 2182 | "name": "punctuation.accessor.js" |
| 2183 | }, |
| 2184 | "3": { |
| 2185 | "name": "support.variable.property.process.js" |
| 2186 | }, |
| 2187 | "4": { |
| 2188 | "name": "support.function.process.js" |
| 2189 | } |
| 2190 | } |
| 2191 | }, |
| 2192 | { |
| 2193 | "match": "(?<!\\.|\\$)\\b(?:(exports)|(module)(?:(\\.)(exports|id|filename|loaded|parent|children))?)\\b(?!\\$)", |
| 2194 | "captures": { |
| 2195 | "1": { |
| 2196 | "name": "support.type.object.module.js" |
| 2197 | }, |
| 2198 | "2": { |
| 2199 | "name": "support.type.object.module.js" |
| 2200 | }, |
| 2201 | "3": { |
| 2202 | "name": "punctuation.accessor.js" |
| 2203 | }, |
| 2204 | "4": { |
| 2205 | "name": "support.type.object.module.js" |
| 2206 | } |
| 2207 | } |
| 2208 | }, |
| 2209 | { |
| 2210 | "name": "support.variable.object.node.js", |
| 2211 | "match": "(?<!\\.|\\$)\\b(global|GLOBAL|root|__dirname|__filename)\\b(?!\\$)" |
| 2212 | }, |
| 2213 | { |
| 2214 | "match": "(?x) (\\.) \\s* \n(?:\n (on(?:Rowsinserted|Rowsdelete|Rowenter|Rowexit|Resize|Resizestart|Resizeend|Reset|\n Readystatechange|Mouseout|Mouseover|Mousedown|Mouseup|Mousemove|\n Before(?:cut|deactivate|unload|update|paste|print|editfocus|activate)|\n Blur|Scrolltop|Submit|Select|Selectstart|Selectionchange|Hover|Help|\n Change|Contextmenu|Controlselect|Cut|Cellchange|Clock|Close|Deactivate|\n Datasetchanged|Datasetcomplete|Dataavailable|Drop|Drag|Dragstart|Dragover|\n Dragdrop|Dragenter|Dragend|Dragleave|Dblclick|Unload|Paste|Propertychange|Error|\n Errorupdate|Keydown|Keyup|Keypress|Focus|Load|Activate|Afterupdate|Afterprint|Abort)\n ) |\n (shift|showModelessDialog|showModalDialog|showHelp|scroll|scrollX|scrollByPages|\n scrollByLines|scrollY|scrollTo|stop|strike|sizeToContent|sidebar|signText|sort|\n sup|sub|substr|substring|splice|split|send|set(?:Milliseconds|Seconds|Minutes|Hours|\n Month|Year|FullYear|Date|UTC(?:Milliseconds|Seconds|Minutes|Hours|Month|FullYear|Date)|\n Time|Hotkeys|Cursor|ZOptions|Active|Resizable|RequestHeader)|search|slice|\n savePreferences|small|home|handleEvent|navigate|char|charCodeAt|charAt|concat|\n contextual|confirm|compile|clear|captureEvents|call|createStyleSheet|createPopup|\n createEventObject|to(?:GMTString|UTCString|String|Source|UpperCase|LowerCase|LocaleString)|\n test|taint|taintEnabled|indexOf|italics|disableExternalCapture|dump|detachEvent|unshift|\n untaint|unwatch|updateCommands|join|javaEnabled|pop|push|plugins.refresh|paddings|parse|\n print|prompt|preference|enableExternalCapture|exec|execScript|valueOf|UTC|find|file|\n fileModifiedDate|fileSize|fileCreatedDate|fileUpdatedDate|fixed|fontsize|fontcolor|\n forward|fromCharCode|watch|link|load|lastIndexOf|anchor|attachEvent|atob|apply|alert|\n abort|routeEvents|resize|resizeBy|resizeTo|recalc|returnValue|replace|reverse|reload|\n releaseCapture|releaseEvents|go|get(?:Milliseconds|Seconds|Minutes|Hours|Month|Day|Year|FullYear|\n Time|Date|TimezoneOffset|UTC(?:Milliseconds|Seconds|Minutes|Hours|Day|Month|FullYear|Date)|\n Attention|Selection|ResponseHeader|AllResponseHeaders)|moveBy|moveBelow|moveTo|\n moveToAbsolute|moveAbove|mergeAttributes|match|margins|btoa|big|bold|borderWidths|blink|back\n ) |\n (acceptNode|add|addEventListener|addTextTrack|adoptNode|after|animate|append|\n appendChild|appendData|before|blur|canPlayType|captureStream|\n caretPositionFromPoint|caretRangeFromPoint|checkValidity|clear|click|\n cloneContents|cloneNode|cloneRange|close|closest|collapse|\n compareBoundaryPoints|compareDocumentPosition|comparePoint|contains|\n convertPointFromNode|convertQuadFromNode|convertRectFromNode|createAttribute|\n createAttributeNS|createCaption|createCDATASection|createComment|\n createContextualFragment|createDocument|createDocumentFragment|\n createDocumentType|createElement|createElementNS|createEntityReference|\n createEvent|createExpression|createHTMLDocument|createNodeIterator|\n createNSResolver|createProcessingInstruction|createRange|createShadowRoot|\n createTBody|createTextNode|createTFoot|createTHead|createTreeWalker|delete|\n deleteCaption|deleteCell|deleteContents|deleteData|deleteRow|deleteTFoot|\n deleteTHead|detach|disconnect|dispatchEvent|elementFromPoint|elementsFromPoint|\n enableStyleSheetsForSet|entries|evaluate|execCommand|exitFullscreen|\n exitPointerLock|expand|extractContents|fastSeek|firstChild|focus|forEach|get|\n getAll|getAnimations|getAttribute|getAttributeNames|getAttributeNode|\n getAttributeNodeNS|getAttributeNS|getBoundingClientRect|getBoxQuads|\n getClientRects|getContext|getDestinationInsertionPoints|getElementById|\n getElementsByClassName|getElementsByName|getElementsByTagName|\n getElementsByTagNameNS|getItem|getNamedItem|getSelection|getStartDate|\n getVideoPlaybackQuality|has|hasAttribute|hasAttributeNS|hasAttributes|\n hasChildNodes|hasFeature|hasFocus|importNode|initEvent|insertAdjacentElement|\n insertAdjacentHTML|insertAdjacentText|insertBefore|insertCell|insertData|\n insertNode|insertRow|intersectsNode|isDefaultNamespace|isEqualNode|\n isPointInRange|isSameNode|item|key|keys|lastChild|load|lookupNamespaceURI|\n lookupPrefix|matches|move|moveAttribute|moveAttributeNode|moveChild|\n moveNamedItem|namedItem|nextNode|nextSibling|normalize|observe|open|\n parentNode|pause|play|postMessage|prepend|preventDefault|previousNode|\n previousSibling|probablySupportsContext|queryCommandEnabled|\n queryCommandIndeterm|queryCommandState|queryCommandSupported|queryCommandValue|\n querySelector|querySelectorAll|registerContentHandler|registerElement|\n registerProtocolHandler|releaseCapture|releaseEvents|remove|removeAttribute|\n removeAttributeNode|removeAttributeNS|removeChild|removeEventListener|\n removeItem|replace|replaceChild|replaceData|replaceWith|reportValidity|\n requestFullscreen|requestPointerLock|reset|scroll|scrollBy|scrollIntoView|\n scrollTo|seekToNextFrame|select|selectNode|selectNodeContents|set|setAttribute|\n setAttributeNode|setAttributeNodeNS|setAttributeNS|setCapture|\n setCustomValidity|setEnd|setEndAfter|setEndBefore|setItem|setNamedItem|\n setRangeText|setSelectionRange|setSinkId|setStart|setStartAfter|setStartBefore|\n slice|splitText|stepDown|stepUp|stopImmediatePropagation|stopPropagation|\n submit|substringData|supports|surroundContents|takeRecords|terminate|toBlob|\n toDataURL|toggle|toString|values|write|writeln\n )\n)(?=\\s*\\()", |
| 2215 | "captures": { |
| 2216 | "1": { |
| 2217 | "name": "punctuation.accessor.js" |
| 2218 | }, |
| 2219 | "2": { |
| 2220 | "name": "support.function.event-handler.js" |
| 2221 | }, |
| 2222 | "3": { |
| 2223 | "name": "support.function.js" |
| 2224 | }, |
| 2225 | "4": { |
| 2226 | "name": "support.function.dom.js" |
| 2227 | } |
| 2228 | } |
| 2229 | } |
| 2230 | ] |
| 2231 | }, |
| 2232 | "function-call": { |
| 2233 | "begin": "(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()", |
| 2234 | "end": "(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()", |
| 2235 | "patterns": [ |
| 2236 | { |
| 2237 | "include": "#support-objects" |
| 2238 | }, |
| 2239 | { |
| 2240 | "name": "punctuation.accessor.js", |
| 2241 | "match": "\\." |
| 2242 | }, |
| 2243 | { |
| 2244 | "name": "entity.name.function.js", |
| 2245 | "match": "([_$[:alpha:]][_$[:alnum:]]*)" |
| 2246 | }, |
| 2247 | { |
| 2248 | "include": "#comment" |
| 2249 | }, |
| 2250 | { |
| 2251 | "name": "meta.type.parameters.js", |
| 2252 | "begin": "\\<", |
| 2253 | "beginCaptures": { |
| 2254 | "0": { |
| 2255 | "name": "punctuation.definition.typeparameters.begin.js" |
| 2256 | } |
| 2257 | }, |
| 2258 | "end": "\\>", |
| 2259 | "endCaptures": { |
| 2260 | "0": { |
| 2261 | "name": "punctuation.definition.typeparameters.end.js" |
| 2262 | } |
| 2263 | }, |
| 2264 | "patterns": [ |
| 2265 | { |
| 2266 | "include": "#type" |
| 2267 | }, |
| 2268 | { |
| 2269 | "include": "#punctuation-comma" |
| 2270 | } |
| 2271 | ] |
| 2272 | }, |
| 2273 | { |
| 2274 | "include": "#paren-expression" |
| 2275 | } |
| 2276 | ] |
| 2277 | }, |
| 2278 | "identifiers": { |
| 2279 | "patterns": [ |
| 2280 | { |
| 2281 | "name": "support.class.js", |
| 2282 | "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))" |
| 2283 | }, |
| 2284 | { |
| 2285 | "match": "(?x)(\\.)\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", |
| 2286 | "captures": { |
| 2287 | "1": { |
| 2288 | "name": "punctuation.accessor.js" |
| 2289 | }, |
| 2290 | "2": { |
| 2291 | "name": "constant.other.object.property.js" |
| 2292 | }, |
| 2293 | "3": { |
| 2294 | "name": "variable.other.object.property.js" |
| 2295 | } |
| 2296 | } |
| 2297 | }, |
| 2298 | { |
| 2299 | "match": "(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*( (async\\s+)|(function\\s*[(<])|(function\\s+)| ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)| ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))", |
| 2300 | "captures": { |
| 2301 | "1": { |
| 2302 | "name": "punctuation.accessor.js" |
| 2303 | }, |
| 2304 | "2": { |
| 2305 | "name": "entity.name.function.js" |
| 2306 | } |
| 2307 | } |
| 2308 | }, |
| 2309 | { |
| 2310 | "match": "(\\.)\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", |
| 2311 | "captures": { |
| 2312 | "1": { |
| 2313 | "name": "punctuation.accessor.js" |
| 2314 | }, |
| 2315 | "2": { |
| 2316 | "name": "constant.other.property.js" |
| 2317 | } |
| 2318 | } |
| 2319 | }, |
| 2320 | { |
| 2321 | "match": "(\\.)\\s*([_$[:alpha:]][_$[:alnum:]]*)", |
| 2322 | "captures": { |
| 2323 | "1": { |
| 2324 | "name": "punctuation.accessor.js" |
| 2325 | }, |
| 2326 | "2": { |
| 2327 | "name": "variable.other.property.js" |
| 2328 | } |
| 2329 | } |
| 2330 | }, |
| 2331 | { |
| 2332 | "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", |
| 2333 | "captures": { |
| 2334 | "1": { |
| 2335 | "name": "constant.other.object.js" |
| 2336 | }, |
| 2337 | "2": { |
| 2338 | "name": "variable.other.object.js" |
| 2339 | } |
| 2340 | } |
| 2341 | }, |
| 2342 | { |
| 2343 | "name": "constant.other.js", |
| 2344 | "match": "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])" |
| 2345 | }, |
| 2346 | { |
| 2347 | "name": "variable.other.readwrite.js", |
| 2348 | "match": "[_$[:alpha:]][_$[:alnum:]]*" |
| 2349 | } |
| 2350 | ] |
| 2351 | }, |
| 2352 | "cast": { |
| 2353 | "patterns": [ |
| 2354 | { |
| 2355 | "include": "#jsx" |
| 2356 | } |
| 2357 | ] |
| 2358 | }, |
| 2359 | "new-expr": { |
| 2360 | "name": "new.expr.js", |
| 2361 | "begin": "(?<!\\.|\\$)\\b(new)\\b(?!\\$)", |
| 2362 | "beginCaptures": { |
| 2363 | "1": { |
| 2364 | "name": "keyword.operator.new.js" |
| 2365 | } |
| 2366 | }, |
| 2367 | "end": "(?<=\\))|(?=[;),]|$|((?<!\\.|\\$)\\bnew\\b(?!\\$)))", |
| 2368 | "patterns": [ |
| 2369 | { |
| 2370 | "include": "#paren-expression" |
| 2371 | }, |
| 2372 | { |
| 2373 | "include": "#class-or-interface-declaration" |
| 2374 | }, |
| 2375 | { |
| 2376 | "include": "#type" |
| 2377 | } |
| 2378 | ] |
| 2379 | }, |
| 2380 | "object-member": { |
| 2381 | "patterns": [ |
| 2382 | { |
| 2383 | "include": "#comment" |
| 2384 | }, |
| 2385 | { |
| 2386 | "include": "#method-declaration" |
| 2387 | }, |
| 2388 | { |
| 2389 | "name": "meta.object.member.js", |
| 2390 | "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)", |
| 2391 | "end": "(?=,|\\})", |
| 2392 | "patterns": [ |
| 2393 | { |
| 2394 | "name": "meta.object-literal.key.js", |
| 2395 | "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)", |
| 2396 | "end": ":", |
| 2397 | "endCaptures": { |
| 2398 | "0": { |
| 2399 | "name": "punctuation.separator.key-value.js" |
| 2400 | } |
| 2401 | }, |
| 2402 | "patterns": [ |
| 2403 | { |
| 2404 | "include": "#string" |
| 2405 | }, |
| 2406 | { |
| 2407 | "include": "#array-literal" |
| 2408 | } |
| 2409 | ] |
| 2410 | }, |
| 2411 | { |
| 2412 | "include": "#expression" |
| 2413 | } |
| 2414 | ] |
| 2415 | }, |
| 2416 | { |
| 2417 | "name": "meta.object.member.js", |
| 2418 | "begin": "(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)(?=\\s*( (async\\s+)|(function\\s*[(<])|(function\\s+)| ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)| ((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))))", |
| 2419 | "beginCaptures": { |
| 2420 | "0": { |
| 2421 | "name": "meta.object-literal.key.js" |
| 2422 | }, |
| 2423 | "1": { |
| 2424 | "name": "entity.name.function.js" |
| 2425 | }, |
| 2426 | "2": { |
| 2427 | "name": "punctuation.separator.key-value.js" |
| 2428 | } |
| 2429 | }, |
| 2430 | "end": "(?=,|\\})", |
| 2431 | "patterns": [ |
| 2432 | { |
| 2433 | "include": "#expression" |
| 2434 | } |
| 2435 | ] |
| 2436 | }, |
| 2437 | { |
| 2438 | "name": "meta.object.member.js", |
| 2439 | "begin": "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(:)", |
| 2440 | "beginCaptures": { |
| 2441 | "0": { |
| 2442 | "name": "meta.object-literal.key.js" |
| 2443 | }, |
| 2444 | "1": { |
| 2445 | "name": "punctuation.separator.key-value.js" |
| 2446 | } |
| 2447 | }, |
| 2448 | "end": "(?=,|\\})", |
| 2449 | "patterns": [ |
| 2450 | { |
| 2451 | "include": "#expression" |
| 2452 | } |
| 2453 | ] |
| 2454 | }, |
| 2455 | { |
| 2456 | "name": "meta.object.member.js", |
| 2457 | "begin": "\\.\\.\\.", |
| 2458 | "beginCaptures": { |
| 2459 | "0": { |
| 2460 | "name": "keyword.operator.spread.js" |
| 2461 | } |
| 2462 | }, |
| 2463 | "end": "(?=,|\\})", |
| 2464 | "patterns": [ |
| 2465 | { |
| 2466 | "include": "#expression" |
| 2467 | } |
| 2468 | ] |
| 2469 | }, |
| 2470 | { |
| 2471 | "name": "meta.object.member.js", |
| 2472 | "match": "([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$)", |
| 2473 | "captures": { |
| 2474 | "1": { |
| 2475 | "name": "variable.other.readwrite.js" |
| 2476 | } |
| 2477 | } |
| 2478 | }, |
| 2479 | { |
| 2480 | "include": "#punctuation-comma" |
| 2481 | } |
| 2482 | ] |
| 2483 | }, |
| 2484 | "expression-operators": { |
| 2485 | "patterns": [ |
| 2486 | { |
| 2487 | "name": "keyword.control.flow.js", |
| 2488 | "match": "(?<!\\.|\\$)\\b(await)\\b(?!\\$)" |
| 2489 | }, |
| 2490 | { |
| 2491 | "name": "keyword.operator.expression.delete.js", |
| 2492 | "match": "(?<!\\.|\\$)\\bdelete\\b(?!\\$)" |
| 2493 | }, |
| 2494 | { |
| 2495 | "name": "keyword.operator.expression.in.js", |
| 2496 | "match": "(?<!\\.|\\$)\\bin\\b(?!\\$)" |
| 2497 | }, |
| 2498 | { |
| 2499 | "name": "keyword.operator.expression.of.js", |
| 2500 | "match": "(?<!\\.|\\$)\\bof\\b(?!\\$)" |
| 2501 | }, |
| 2502 | { |
| 2503 | "name": "keyword.operator.expression.instanceof.js", |
| 2504 | "match": "(?<!\\.|\\$)\\binstanceof\\b(?!\\$)" |
| 2505 | }, |
| 2506 | { |
| 2507 | "name": "keyword.operator.new.js", |
| 2508 | "match": "(?<!\\.|\\$)\\bnew\\b(?!\\$)" |
| 2509 | }, |
| 2510 | { |
| 2511 | "include": "#typeof-operator" |
| 2512 | }, |
| 2513 | { |
| 2514 | "name": "keyword.operator.expression.void.js", |
| 2515 | "match": "(?<!\\.|\\$)\\bvoid\\b(?!\\$)" |
| 2516 | }, |
| 2517 | { |
| 2518 | "begin": "(?<!\\.|\\$)\\bas\\b(?!\\$)", |
| 2519 | "beginCaptures": { |
| 2520 | "0": { |
| 2521 | "name": "keyword.control.as.js" |
| 2522 | } |
| 2523 | }, |
| 2524 | "end": "(?=$|[;,:})\\]])", |
| 2525 | "patterns": [ |
| 2526 | { |
| 2527 | "include": "#type" |
| 2528 | } |
| 2529 | ] |
| 2530 | }, |
| 2531 | { |
| 2532 | "name": "keyword.operator.spread.js", |
| 2533 | "match": "\\.\\.\\." |
| 2534 | }, |
| 2535 | { |
| 2536 | "name": "keyword.operator.assignment.compound.js", |
| 2537 | "match": "\\*=|(?<!\\()/=|%=|\\+=|\\-=" |
| 2538 | }, |
| 2539 | { |
| 2540 | "name": "keyword.operator.assignment.compound.bitwise.js", |
| 2541 | "match": "\\&=|\\^=|<<=|>>=|>>>=|\\|=" |
| 2542 | }, |
| 2543 | { |
| 2544 | "name": "keyword.operator.bitwise.shift.js", |
| 2545 | "match": "<<|>>>|>>" |
| 2546 | }, |
| 2547 | { |
| 2548 | "name": "keyword.operator.comparison.js", |
| 2549 | "match": "===|!==|==|!=" |
| 2550 | }, |
| 2551 | { |
| 2552 | "name": "keyword.operator.relational.js", |
| 2553 | "match": "<=|>=|<>|<|>" |
| 2554 | }, |
| 2555 | { |
| 2556 | "name": "keyword.operator.logical.js", |
| 2557 | "match": "\\!|&&|\\|\\|" |
| 2558 | }, |
| 2559 | { |
| 2560 | "name": "keyword.operator.bitwise.js", |
| 2561 | "match": "\\&|~|\\^|\\|" |
| 2562 | }, |
| 2563 | { |
| 2564 | "name": "keyword.operator.assignment.js", |
| 2565 | "match": "\\=" |
| 2566 | }, |
| 2567 | { |
| 2568 | "name": "keyword.operator.decrement.js", |
| 2569 | "match": "--" |
| 2570 | }, |
| 2571 | { |
| 2572 | "name": "keyword.operator.increment.js", |
| 2573 | "match": "\\+\\+" |
| 2574 | }, |
| 2575 | { |
| 2576 | "name": "keyword.operator.arithmetic.js", |
| 2577 | "match": "%|\\*|/|-|\\+" |
| 2578 | }, |
| 2579 | { |
| 2580 | "match": "(?<=[_$[:alnum:]])\\s*(/)(?![/*])", |
| 2581 | "captures": { |
| 2582 | "1": { |
| 2583 | "name": "keyword.operator.arithmetic.js" |
| 2584 | } |
| 2585 | } |
| 2586 | } |
| 2587 | ] |
| 2588 | }, |
| 2589 | "typeof-operator": { |
| 2590 | "name": "keyword.operator.expression.typeof.js", |
| 2591 | "match": "(?<!\\.|\\$)\\btypeof\\b(?!\\$)" |
| 2592 | }, |
| 2593 | "arrow-function": { |
| 2594 | "patterns": [ |
| 2595 | { |
| 2596 | "name": "meta.arrow.js", |
| 2597 | "match": "(?<!\\.|\\$)(\\basync)(?=\\s*[<(])", |
| 2598 | "captures": { |
| 2599 | "1": { |
| 2600 | "name": "storage.modifier.async.js" |
| 2601 | } |
| 2602 | } |
| 2603 | }, |
| 2604 | { |
| 2605 | "name": "meta.arrow.js", |
| 2606 | "match": "(?:(?<!\\.|\\$)(\\basync)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?==>)", |
| 2607 | "captures": { |
| 2608 | "1": { |
| 2609 | "name": "storage.modifier.async.js" |
| 2610 | }, |
| 2611 | "2": { |
| 2612 | "name": "variable.parameter.js" |
| 2613 | } |
| 2614 | } |
| 2615 | }, |
| 2616 | { |
| 2617 | "name": "meta.arrow.js", |
| 2618 | "begin": "(?x)\\s*(?=(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)", |
| 2619 | "end": "(?==>)", |
| 2620 | "patterns": [ |
| 2621 | { |
| 2622 | "include": "#comment" |
| 2623 | }, |
| 2624 | { |
| 2625 | "include": "#type-parameters" |
| 2626 | }, |
| 2627 | { |
| 2628 | "include": "#function-parameters" |
| 2629 | }, |
| 2630 | { |
| 2631 | "include": "#arrow-return-type" |
| 2632 | } |
| 2633 | ] |
| 2634 | }, |
| 2635 | { |
| 2636 | "name": "meta.arrow.js", |
| 2637 | "begin": "=>", |
| 2638 | "beginCaptures": { |
| 2639 | "0": { |
| 2640 | "name": "storage.type.function.arrow.js" |
| 2641 | } |
| 2642 | }, |
| 2643 | "end": "(?<=\\})|((?!\\{)(?=\\S))", |
| 2644 | "patterns": [ |
| 2645 | { |
| 2646 | "include": "#decl-block" |
| 2647 | }, |
| 2648 | { |
| 2649 | "include": "#expression" |
| 2650 | } |
| 2651 | ] |
| 2652 | } |
| 2653 | ] |
| 2654 | }, |
| 2655 | "arrow-return-type": { |
| 2656 | "name": "meta.return.type.arrow.js", |
| 2657 | "begin": "(?<=\\))\\s*(:)", |
| 2658 | "beginCaptures": { |
| 2659 | "1": { |
| 2660 | "name": "keyword.operator.type.annotation.js" |
| 2661 | } |
| 2662 | }, |
| 2663 | "end": "(?<!:)((?=$)|(?==>|;|//))", |
| 2664 | "patterns": [ |
| 2665 | { |
| 2666 | "include": "#type-predicate-operator" |
| 2667 | }, |
| 2668 | { |
| 2669 | "include": "#type" |
| 2670 | } |
| 2671 | ] |
| 2672 | }, |
| 2673 | "punctuation-comma": { |
| 2674 | "name": "punctuation.separator.comma.js", |
| 2675 | "match": "," |
| 2676 | }, |
| 2677 | "punctuation-semicolon": { |
| 2678 | "name": "punctuation.terminator.statement.js", |
| 2679 | "match": ";" |
| 2680 | }, |
| 2681 | "punctuation-accessor": { |
| 2682 | "name": "punctuation.accessor.js", |
| 2683 | "match": "\\." |
| 2684 | }, |
| 2685 | "paren-expression": { |
| 2686 | "begin": "\\(", |
| 2687 | "beginCaptures": { |
| 2688 | "0": { |
| 2689 | "name": "meta.brace.round.js" |
| 2690 | } |
| 2691 | }, |
| 2692 | "end": "\\)", |
| 2693 | "endCaptures": { |
| 2694 | "0": { |
| 2695 | "name": "meta.brace.round.js" |
| 2696 | } |
| 2697 | }, |
| 2698 | "patterns": [ |
| 2699 | { |
| 2700 | "include": "#expression" |
| 2701 | }, |
| 2702 | { |
| 2703 | "include": "#punctuation-comma" |
| 2704 | } |
| 2705 | ] |
| 2706 | }, |
| 2707 | "qstring-double": { |
| 2708 | "name": "string.quoted.double.js", |
| 2709 | "begin": "\"", |
| 2710 | "beginCaptures": { |
| 2711 | "0": { |
| 2712 | "name": "punctuation.definition.string.begin.js" |
| 2713 | } |
| 2714 | }, |
| 2715 | "end": "(\")|((?:[^\\\\\\n])$)", |
| 2716 | "endCaptures": { |
| 2717 | "1": { |
| 2718 | "name": "punctuation.definition.string.end.js" |
| 2719 | }, |
| 2720 | "2": { |
| 2721 | "name": "invalid.illegal.newline.js" |
| 2722 | } |
| 2723 | }, |
| 2724 | "patterns": [ |
| 2725 | { |
| 2726 | "include": "#string-character-escape" |
| 2727 | } |
| 2728 | ] |
| 2729 | }, |
| 2730 | "qstring-single": { |
| 2731 | "name": "string.quoted.single.js", |
| 2732 | "begin": "'", |
| 2733 | "beginCaptures": { |
| 2734 | "0": { |
| 2735 | "name": "punctuation.definition.string.begin.js" |
| 2736 | } |
| 2737 | }, |
| 2738 | "end": "(\\')|((?:[^\\\\\\n])$)", |
| 2739 | "endCaptures": { |
| 2740 | "1": { |
| 2741 | "name": "punctuation.definition.string.end.js" |
| 2742 | }, |
| 2743 | "2": { |
| 2744 | "name": "invalid.illegal.newline.js" |
| 2745 | } |
| 2746 | }, |
| 2747 | "patterns": [ |
| 2748 | { |
| 2749 | "include": "#string-character-escape" |
| 2750 | } |
| 2751 | ] |
| 2752 | }, |
| 2753 | "regex": { |
| 2754 | "patterns": [ |
| 2755 | { |
| 2756 | "name": "string.regex.js", |
| 2757 | "begin": "(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))", |
| 2758 | "beginCaptures": { |
| 2759 | "1": { |
| 2760 | "name": "punctuation.definition.string.begin.js" |
| 2761 | } |
| 2762 | }, |
| 2763 | "end": "(/)([gimuy]*)", |
| 2764 | "endCaptures": { |
| 2765 | "1": { |
| 2766 | "name": "punctuation.definition.string.end.js" |
| 2767 | }, |
| 2768 | "2": { |
| 2769 | "name": "keyword.other.js" |
| 2770 | } |
| 2771 | }, |
| 2772 | "patterns": [ |
| 2773 | { |
| 2774 | "include": "#regexp" |
| 2775 | } |
| 2776 | ] |
| 2777 | }, |
| 2778 | { |
| 2779 | "name": "string.regex.js", |
| 2780 | "begin": "/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))", |
| 2781 | "beginCaptures": { |
| 2782 | "0": { |
| 2783 | "name": "punctuation.definition.string.begin.js" |
| 2784 | } |
| 2785 | }, |
| 2786 | "end": "(/)([gimuy]*)", |
| 2787 | "endCaptures": { |
| 2788 | "1": { |
| 2789 | "name": "punctuation.definition.string.end.js" |
| 2790 | }, |
| 2791 | "2": { |
| 2792 | "name": "keyword.other.js" |
| 2793 | } |
| 2794 | }, |
| 2795 | "patterns": [ |
| 2796 | { |
| 2797 | "include": "#regexp" |
| 2798 | } |
| 2799 | ] |
| 2800 | } |
| 2801 | ] |
| 2802 | }, |
| 2803 | "regexp": { |
| 2804 | "patterns": [ |
| 2805 | { |
| 2806 | "name": "keyword.control.anchor.regexp", |
| 2807 | "match": "\\\\[bB]|\\^|\\$" |
| 2808 | }, |
| 2809 | { |
| 2810 | "name": "keyword.other.back-reference.regexp", |
| 2811 | "match": "\\\\[1-9]\\d*" |
| 2812 | }, |
| 2813 | { |
| 2814 | "name": "keyword.operator.quantifier.regexp", |
| 2815 | "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??" |
| 2816 | }, |
| 2817 | { |
| 2818 | "name": "keyword.operator.or.regexp", |
| 2819 | "match": "\\|" |
| 2820 | }, |
| 2821 | { |
| 2822 | "name": "meta.group.assertion.regexp", |
| 2823 | "begin": "(\\()((\\?=)|(\\?!))", |
| 2824 | "beginCaptures": { |
| 2825 | "1": { |
| 2826 | "name": "punctuation.definition.group.regexp" |
| 2827 | }, |
| 2828 | "2": { |
| 2829 | "name": "punctuation.definition.group.assertion.regexp" |
| 2830 | }, |
| 2831 | "3": { |
| 2832 | "name": "meta.assertion.look-ahead.regexp" |
| 2833 | }, |
| 2834 | "4": { |
| 2835 | "name": "meta.assertion.negative-look-ahead.regexp" |
| 2836 | } |
| 2837 | }, |
| 2838 | "end": "(\\))", |
| 2839 | "endCaptures": { |
| 2840 | "1": { |
| 2841 | "name": "punctuation.definition.group.regexp" |
| 2842 | } |
| 2843 | }, |
| 2844 | "patterns": [ |
| 2845 | { |
| 2846 | "include": "#regexp" |
| 2847 | } |
| 2848 | ] |
| 2849 | }, |
| 2850 | { |
| 2851 | "name": "meta.group.regexp", |
| 2852 | "begin": "\\((\\?:)?", |
| 2853 | "beginCaptures": { |
| 2854 | "0": { |
| 2855 | "name": "punctuation.definition.group.regexp" |
| 2856 | }, |
| 2857 | "1": { |
| 2858 | "name": "punctuation.definition.group.capture.regexp" |
| 2859 | } |
| 2860 | }, |
| 2861 | "end": "\\)", |
| 2862 | "endCaptures": { |
| 2863 | "0": { |
| 2864 | "name": "punctuation.definition.group.regexp" |
| 2865 | } |
| 2866 | }, |
| 2867 | "patterns": [ |
| 2868 | { |
| 2869 | "include": "#regexp" |
| 2870 | } |
| 2871 | ] |
| 2872 | }, |
| 2873 | { |
| 2874 | "name": "constant.other.character-class.set.regexp", |
| 2875 | "begin": "(\\[)(\\^)?", |
| 2876 | "beginCaptures": { |
| 2877 | "1": { |
| 2878 | "name": "punctuation.definition.character-class.regexp" |
| 2879 | }, |
| 2880 | "2": { |
| 2881 | "name": "keyword.operator.negation.regexp" |
| 2882 | } |
| 2883 | }, |
| 2884 | "end": "(\\])", |
| 2885 | "endCaptures": { |
| 2886 | "1": { |
| 2887 | "name": "punctuation.definition.character-class.regexp" |
| 2888 | } |
| 2889 | }, |
| 2890 | "patterns": [ |
| 2891 | { |
| 2892 | "name": "constant.other.character-class.range.regexp", |
| 2893 | "match": "(?:.|(\\\\(?:[0-7]{3}|x\\h\\h|u\\h\\h\\h\\h))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x\\h\\h|u\\h\\h\\h\\h))|(\\\\c[A-Z])|(\\\\.))", |
| 2894 | "captures": { |
| 2895 | "1": { |
| 2896 | "name": "constant.character.numeric.regexp" |
| 2897 | }, |
| 2898 | "2": { |
| 2899 | "name": "constant.character.control.regexp" |
| 2900 | }, |
| 2901 | "3": { |
| 2902 | "name": "constant.character.escape.backslash.regexp" |
| 2903 | }, |
| 2904 | "4": { |
| 2905 | "name": "constant.character.numeric.regexp" |
| 2906 | }, |
| 2907 | "5": { |
| 2908 | "name": "constant.character.control.regexp" |
| 2909 | }, |
| 2910 | "6": { |
| 2911 | "name": "constant.character.escape.backslash.regexp" |
| 2912 | } |
| 2913 | } |
| 2914 | }, |
| 2915 | { |
| 2916 | "include": "#regex-character-class" |
| 2917 | } |
| 2918 | ] |
| 2919 | }, |
| 2920 | { |
| 2921 | "include": "#regex-character-class" |
| 2922 | } |
| 2923 | ] |
| 2924 | }, |
| 2925 | "regex-character-class": { |
| 2926 | "patterns": [ |
| 2927 | { |
| 2928 | "name": "constant.other.character-class.regexp", |
| 2929 | "match": "\\\\[wWsSdDtrnvf]|\\." |
| 2930 | }, |
| 2931 | { |
| 2932 | "name": "constant.character.numeric.regexp", |
| 2933 | "match": "\\\\([0-7]{3}|x\\h\\h|u\\h\\h\\h\\h)" |
| 2934 | }, |
| 2935 | { |
| 2936 | "name": "constant.character.control.regexp", |
| 2937 | "match": "\\\\c[A-Z]" |
| 2938 | }, |
| 2939 | { |
| 2940 | "name": "constant.character.escape.backslash.regexp", |
| 2941 | "match": "\\\\." |
| 2942 | } |
| 2943 | ] |
| 2944 | }, |
| 2945 | "string": { |
| 2946 | "patterns": [ |
| 2947 | { |
| 2948 | "include": "#qstring-single" |
| 2949 | }, |
| 2950 | { |
| 2951 | "include": "#qstring-double" |
| 2952 | } |
| 2953 | ] |
| 2954 | }, |
| 2955 | "template": { |
| 2956 | "name": "string.template.js", |
| 2957 | "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)", |
| 2958 | "beginCaptures": { |
| 2959 | "1": { |
| 2960 | "name": "entity.name.function.tagged-template.js" |
| 2961 | }, |
| 2962 | "2": { |
| 2963 | "name": "punctuation.definition.string.template.begin.js" |
| 2964 | } |
| 2965 | }, |
| 2966 | "end": "`", |
| 2967 | "endCaptures": { |
| 2968 | "0": { |
| 2969 | "name": "punctuation.definition.string.template.end.js" |
| 2970 | } |
| 2971 | }, |
| 2972 | "patterns": [ |
| 2973 | { |
| 2974 | "include": "#template-substitution-element" |
| 2975 | }, |
| 2976 | { |
| 2977 | "include": "#string-character-escape" |
| 2978 | } |
| 2979 | ] |
| 2980 | }, |
| 2981 | "string-character-escape": { |
| 2982 | "name": "constant.character.escape.js", |
| 2983 | "match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" |
| 2984 | }, |
| 2985 | "template-substitution-element": { |
| 2986 | "name": "meta.template.expression.js", |
| 2987 | "begin": "\\$\\{", |
| 2988 | "beginCaptures": { |
| 2989 | "0": { |
| 2990 | "name": "punctuation.definition.template-expression.begin.js" |
| 2991 | } |
| 2992 | }, |
| 2993 | "end": "\\}", |
| 2994 | "endCaptures": { |
| 2995 | "0": { |
| 2996 | "name": "punctuation.definition.template-expression.end.js" |
| 2997 | } |
| 2998 | }, |
| 2999 | "patterns": [ |
| 3000 | { |
| 3001 | "include": "#expression" |
| 3002 | } |
| 3003 | ] |
| 3004 | }, |
| 3005 | "literal": { |
| 3006 | "name": "literal.js", |
| 3007 | "patterns": [ |
| 3008 | { |
| 3009 | "include": "#numeric-literal" |
| 3010 | }, |
| 3011 | { |
| 3012 | "include": "#boolean-literal" |
| 3013 | }, |
| 3014 | { |
| 3015 | "include": "#null-literal" |
| 3016 | }, |
| 3017 | { |
| 3018 | "include": "#undefined-literal" |
| 3019 | }, |
| 3020 | { |
| 3021 | "include": "#numericConstant-literal" |
| 3022 | }, |
| 3023 | { |
| 3024 | "include": "#array-literal" |
| 3025 | }, |
| 3026 | { |
| 3027 | "include": "#this-literal" |
| 3028 | }, |
| 3029 | { |
| 3030 | "include": "#super-literal" |
| 3031 | } |
| 3032 | ] |
| 3033 | }, |
| 3034 | "array-literal": { |
| 3035 | "name": "meta.array.literal.js", |
| 3036 | "begin": "\\[", |
| 3037 | "beginCaptures": { |
| 3038 | "0": { |
| 3039 | "name": "meta.brace.square.js" |
| 3040 | } |
| 3041 | }, |
| 3042 | "end": "\\]", |
| 3043 | "endCaptures": { |
| 3044 | "0": { |
| 3045 | "name": "meta.brace.square.js" |
| 3046 | } |
| 3047 | }, |
| 3048 | "patterns": [ |
| 3049 | { |
| 3050 | "include": "#expression" |
| 3051 | }, |
| 3052 | { |
| 3053 | "include": "#punctuation-comma" |
| 3054 | } |
| 3055 | ] |
| 3056 | }, |
| 3057 | "numeric-literal": { |
| 3058 | "patterns": [ |
| 3059 | { |
| 3060 | "name": "constant.numeric.hex.js", |
| 3061 | "match": "\\b(?<!\\$)0(x|X)[0-9a-fA-F]+\\b(?!\\$)" |
| 3062 | }, |
| 3063 | { |
| 3064 | "name": "constant.numeric.binary.js", |
| 3065 | "match": "\\b(?<!\\$)0(b|B)[01]+\\b(?!\\$)" |
| 3066 | }, |
| 3067 | { |
| 3068 | "name": "constant.numeric.octal.js", |
| 3069 | "match": "\\b(?<!\\$)0(o|O)?[0-7]+\\b(?!\\$)" |
| 3070 | }, |
| 3071 | { |
| 3072 | "match": "(?x)\n(?<!\\$)(?:\n (?:\\b[0-9]+(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # 1.1E+3\n (?:\\b[0-9]+(\\.)[eE][+-]?[0-9]+\\b)| # 1.E+3\n (?:\\B(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # .1E+3\n (?:\\b[0-9]+[eE][+-]?[0-9]+\\b)| # 1E+3\n (?:\\b[0-9]+(\\.)[0-9]+\\b)| # 1.1\n (?:\\b[0-9]+(\\.)\\B)| # 1.\n (?:\\B(\\.)[0-9]+\\b)| # .1\n (?:\\b[0-9]+\\b(?!\\.)) # 1\n)(?!\\$)", |
| 3073 | "captures": { |
| 3074 | "0": { |
| 3075 | "name": "constant.numeric.decimal.js" |
| 3076 | }, |
| 3077 | "1": { |
| 3078 | "name": "meta.delimiter.decimal.period.js" |
| 3079 | }, |
| 3080 | "2": { |
| 3081 | "name": "meta.delimiter.decimal.period.js" |
| 3082 | }, |
| 3083 | "3": { |
| 3084 | "name": "meta.delimiter.decimal.period.js" |
| 3085 | }, |
| 3086 | "4": { |
| 3087 | "name": "meta.delimiter.decimal.period.js" |
| 3088 | }, |
| 3089 | "5": { |
| 3090 | "name": "meta.delimiter.decimal.period.js" |
| 3091 | }, |
| 3092 | "6": { |
| 3093 | "name": "meta.delimiter.decimal.period.js" |
| 3094 | } |
| 3095 | } |
| 3096 | } |
| 3097 | ] |
| 3098 | }, |
| 3099 | "boolean-literal": { |
| 3100 | "patterns": [ |
| 3101 | { |
| 3102 | "name": "constant.language.boolean.true.js", |
| 3103 | "match": "(?<!\\.|\\$)\\btrue\\b(?!\\$)" |
| 3104 | }, |
| 3105 | { |
| 3106 | "name": "constant.language.boolean.false.js", |
| 3107 | "match": "(?<!\\.|\\$)\\bfalse\\b(?!\\$)" |
| 3108 | } |
| 3109 | ] |
| 3110 | }, |
| 3111 | "null-literal": { |
| 3112 | "name": "constant.language.null.js", |
| 3113 | "match": "(?<!\\.|\\$)\\bnull\\b(?!\\$)" |
| 3114 | }, |
| 3115 | "this-literal": { |
| 3116 | "name": "variable.language.this.js", |
| 3117 | "match": "(?<!\\.|\\$)\\bthis\\b(?!\\$)" |
| 3118 | }, |
| 3119 | "super-literal": { |
| 3120 | "name": "variable.language.super.js", |
| 3121 | "match": "(?<!\\.|\\$)\\bsuper\\b(?!\\$)" |
| 3122 | }, |
| 3123 | "undefined-literal": { |
| 3124 | "name": "constant.language.undefined.js", |
| 3125 | "match": "(?<!\\.|\\$)\\bundefined\\b(?!\\$)" |
| 3126 | }, |
| 3127 | "numericConstant-literal": { |
| 3128 | "patterns": [ |
| 3129 | { |
| 3130 | "name": "constant.language.nan.js", |
| 3131 | "match": "(?<!\\.|\\$)\\bNaN\\b(?!\\$)" |
| 3132 | }, |
| 3133 | { |
| 3134 | "name": "constant.language.infinity.js", |
| 3135 | "match": "(?<!\\.|\\$)\\bInfinity\\b(?!\\$)" |
| 3136 | } |
| 3137 | ] |
| 3138 | }, |
| 3139 | "access-modifier": { |
| 3140 | "name": "storage.modifier.js", |
| 3141 | "match": "(?<!\\.|\\$)\\b(abstract|public|protected|private|readonly|static)\\b(?!\\$)" |
| 3142 | }, |
| 3143 | "property-accessor": { |
| 3144 | "name": "storage.type.property.js", |
| 3145 | "match": "(?<!\\.|\\$)\\b(get|set)\\b(?!\\$)" |
| 3146 | }, |
| 3147 | "comment": { |
| 3148 | "patterns": [ |
| 3149 | { |
| 3150 | "name": "comment.block.documentation.js", |
| 3151 | "begin": "/\\*\\*(?!/)", |
| 3152 | "beginCaptures": { |
| 3153 | "0": { |
| 3154 | "name": "punctuation.definition.comment.js" |
| 3155 | } |
| 3156 | }, |
| 3157 | "end": "\\*/", |
| 3158 | "endCaptures": { |
| 3159 | "0": { |
| 3160 | "name": "punctuation.definition.comment.js" |
| 3161 | } |
| 3162 | }, |
| 3163 | "patterns": [ |
| 3164 | { |
| 3165 | "include": "#docblock" |
| 3166 | } |
| 3167 | ] |
| 3168 | }, |
| 3169 | { |
| 3170 | "name": "comment.block.js", |
| 3171 | "begin": "/\\*", |
| 3172 | "beginCaptures": { |
| 3173 | "0": { |
| 3174 | "name": "punctuation.definition.comment.js" |
| 3175 | } |
| 3176 | }, |
| 3177 | "end": "\\*/", |
| 3178 | "endCaptures": { |
| 3179 | "0": { |
| 3180 | "name": "punctuation.definition.comment.js" |
| 3181 | } |
| 3182 | } |
| 3183 | }, |
| 3184 | { |
| 3185 | "begin": "(^[ \\t]+)?(?=//)", |
| 3186 | "beginCaptures": { |
| 3187 | "1": { |
| 3188 | "name": "punctuation.whitespace.comment.leading.js" |
| 3189 | } |
| 3190 | }, |
| 3191 | "end": "(?=$)", |
| 3192 | "patterns": [ |
| 3193 | { |
| 3194 | "name": "comment.line.double-slash.js", |
| 3195 | "begin": "//", |
| 3196 | "beginCaptures": { |
| 3197 | "0": { |
| 3198 | "name": "punctuation.definition.comment.js" |
| 3199 | } |
| 3200 | }, |
| 3201 | "end": "(?=$)" |
| 3202 | } |
| 3203 | ] |
| 3204 | } |
| 3205 | ] |
| 3206 | }, |
| 3207 | "directives": { |
| 3208 | "name": "comment.line.triple-slash.directive.js", |
| 3209 | "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)", |
| 3210 | "beginCaptures": { |
| 3211 | "1": { |
| 3212 | "name": "punctuation.definition.comment.js" |
| 3213 | } |
| 3214 | }, |
| 3215 | "end": "(?=$)", |
| 3216 | "patterns": [ |
| 3217 | { |
| 3218 | "name": "meta.tag.js", |
| 3219 | "begin": "(<)(reference|amd-dependency|amd-module)", |
| 3220 | "beginCaptures": { |
| 3221 | "1": { |
| 3222 | "name": "punctuation.definition.tag.directive.js" |
| 3223 | }, |
| 3224 | "2": { |
| 3225 | "name": "entity.name.tag.directive.js" |
| 3226 | } |
| 3227 | }, |
| 3228 | "end": "/>", |
| 3229 | "endCaptures": { |
| 3230 | "0": { |
| 3231 | "name": "punctuation.definition.tag.directive.js" |
| 3232 | } |
| 3233 | }, |
| 3234 | "patterns": [ |
| 3235 | { |
| 3236 | "name": "entity.other.attribute-name.directive.js", |
| 3237 | "match": "path|types|no-default-lib|name" |
| 3238 | }, |
| 3239 | { |
| 3240 | "name": "keyword.operator.assignment.js", |
| 3241 | "match": "=" |
| 3242 | }, |
| 3243 | { |
| 3244 | "include": "#string" |
| 3245 | } |
| 3246 | ] |
| 3247 | } |
| 3248 | ] |
| 3249 | }, |
| 3250 | "docblock": { |
| 3251 | "patterns": [ |
| 3252 | { |
| 3253 | "name": "storage.type.class.jsdoc", |
| 3254 | "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" |
| 3255 | }, |
| 3256 | { |
| 3257 | "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", |
| 3258 | "captures": { |
| 3259 | "0": { |
| 3260 | "name": "other.meta.jsdoc" |
| 3261 | }, |
| 3262 | "1": { |
| 3263 | "name": "entity.name.type.instance.jsdoc" |
| 3264 | }, |
| 3265 | "2": { |
| 3266 | "name": "variable.other.jsdoc" |
| 3267 | }, |
| 3268 | "3": { |
| 3269 | "name": "other.description.jsdoc" |
| 3270 | } |
| 3271 | } |
| 3272 | }, |
| 3273 | { |
| 3274 | "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", |
| 3275 | "captures": { |
| 3276 | "0": { |
| 3277 | "name": "other.meta.jsdoc" |
| 3278 | }, |
| 3279 | "1": { |
| 3280 | "name": "entity.name.type.instance.jsdoc" |
| 3281 | }, |
| 3282 | "2": { |
| 3283 | "name": "other.description.jsdoc" |
| 3284 | } |
| 3285 | } |
| 3286 | } |
| 3287 | ] |
| 3288 | }, |
| 3289 | "jsx-tag-attributes": { |
| 3290 | "patterns": [ |
| 3291 | { |
| 3292 | "include": "#jsx-tag-attribute-name" |
| 3293 | }, |
| 3294 | { |
| 3295 | "include": "#jsx-tag-attribute-assignment" |
| 3296 | }, |
| 3297 | { |
| 3298 | "include": "#jsx-string-double-quoted" |
| 3299 | }, |
| 3300 | { |
| 3301 | "include": "#jsx-string-single-quoted" |
| 3302 | }, |
| 3303 | { |
| 3304 | "include": "#jsx-evaluated-code" |
| 3305 | } |
| 3306 | ] |
| 3307 | }, |
| 3308 | "jsx-tag-attribute-name": { |
| 3309 | "match": "(?x)\n \\s*\n ([_$a-zA-Z][-$\\w]*)\n (?=\\s|=|/?>|/\\*|//)", |
| 3310 | "captures": { |
| 3311 | "1": { |
| 3312 | "name": "entity.other.attribute-name.js" |
| 3313 | } |
| 3314 | } |
| 3315 | }, |
| 3316 | "jsx-tag-attribute-assignment": { |
| 3317 | "name": "keyword.operator.assignment.js", |
| 3318 | "match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))" |
| 3319 | }, |
| 3320 | "jsx-string-double-quoted": { |
| 3321 | "name": "string.quoted.double.js", |
| 3322 | "begin": "\"", |
| 3323 | "end": "\"", |
| 3324 | "beginCaptures": { |
| 3325 | "0": { |
| 3326 | "name": "punctuation.definition.string.begin.js" |
| 3327 | } |
| 3328 | }, |
| 3329 | "endCaptures": { |
| 3330 | "0": { |
| 3331 | "name": "punctuation.definition.string.end.js" |
| 3332 | } |
| 3333 | }, |
| 3334 | "patterns": [ |
| 3335 | { |
| 3336 | "include": "#jsx-entities" |
| 3337 | } |
| 3338 | ] |
| 3339 | }, |
| 3340 | "jsx-string-single-quoted": { |
| 3341 | "name": "string.quoted.single.js", |
| 3342 | "begin": "'", |
| 3343 | "end": "'", |
| 3344 | "beginCaptures": { |
| 3345 | "0": { |
| 3346 | "name": "punctuation.definition.string.begin.js" |
| 3347 | } |
| 3348 | }, |
| 3349 | "endCaptures": { |
| 3350 | "0": { |
| 3351 | "name": "punctuation.definition.string.end.js" |
| 3352 | } |
| 3353 | }, |
| 3354 | "patterns": [ |
| 3355 | { |
| 3356 | "include": "#jsx-entities" |
| 3357 | } |
| 3358 | ] |
| 3359 | }, |
| 3360 | "jsx-entities": { |
| 3361 | "patterns": [ |
| 3362 | { |
| 3363 | "name": "constant.character.entity.js", |
| 3364 | "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)", |
| 3365 | "captures": { |
| 3366 | "1": { |
| 3367 | "name": "punctuation.definition.entity.js" |
| 3368 | }, |
| 3369 | "3": { |
| 3370 | "name": "punctuation.definition.entity.js" |
| 3371 | } |
| 3372 | } |
| 3373 | }, |
| 3374 | { |
| 3375 | "name": "invalid.illegal.bad-ampersand.js", |
| 3376 | "match": "&" |
| 3377 | } |
| 3378 | ] |
| 3379 | }, |
| 3380 | "jsx-evaluated-code": { |
| 3381 | "name": "meta.embedded.expression.js", |
| 3382 | "begin": "{", |
| 3383 | "end": "}", |
| 3384 | "beginCaptures": { |
| 3385 | "0": { |
| 3386 | "name": "punctuation.section.embedded.begin.js" |
| 3387 | } |
| 3388 | }, |
| 3389 | "endCaptures": { |
| 3390 | "0": { |
| 3391 | "name": "punctuation.section.embedded.end.js" |
| 3392 | } |
| 3393 | }, |
| 3394 | "patterns": [ |
| 3395 | { |
| 3396 | "include": "#expression" |
| 3397 | } |
| 3398 | ] |
| 3399 | }, |
| 3400 | "jsx-tag-attributes-illegal": { |
| 3401 | "name": "invalid.illegal.attribute.js", |
| 3402 | "match": "\\S+" |
| 3403 | }, |
| 3404 | "jsx-tag-without-attributes": { |
| 3405 | "name": "meta.tag.without-attributes.js", |
| 3406 | "begin": "(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)", |
| 3407 | "end": "(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)", |
| 3408 | "beginCaptures": { |
| 3409 | "1": { |
| 3410 | "name": "punctuation.definition.tag.begin.js" |
| 3411 | }, |
| 3412 | "2": { |
| 3413 | "name": "entity.name.tag.js" |
| 3414 | }, |
| 3415 | "3": { |
| 3416 | "name": "punctuation.definition.tag.end.js" |
| 3417 | } |
| 3418 | }, |
| 3419 | "endCaptures": { |
| 3420 | "1": { |
| 3421 | "name": "punctuation.definition.tag.begin.js" |
| 3422 | }, |
| 3423 | "2": { |
| 3424 | "name": "entity.name.tag.js" |
| 3425 | }, |
| 3426 | "3": { |
| 3427 | "name": "punctuation.definition.tag.end.js" |
| 3428 | } |
| 3429 | }, |
| 3430 | "contentName": "meta.jsx.children.tsx", |
| 3431 | "patterns": [ |
| 3432 | { |
| 3433 | "include": "#jsx-children" |
| 3434 | } |
| 3435 | ] |
| 3436 | }, |
| 3437 | "jsx-tag-in-expression": { |
| 3438 | "begin": "(?x)\n (?<=[({\\[,?=>]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n (?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)) #look ahead is not start of tag without attributes\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))", |
| 3439 | "end": "(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))", |
| 3440 | "endCaptures": { |
| 3441 | "0": { |
| 3442 | "name": "meta.tag.js" |
| 3443 | }, |
| 3444 | "1": { |
| 3445 | "name": "punctuation.definition.tag.end.js" |
| 3446 | }, |
| 3447 | "2": { |
| 3448 | "name": "punctuation.definition.tag.begin.js" |
| 3449 | }, |
| 3450 | "3": { |
| 3451 | "name": "entity.name.tag.js" |
| 3452 | }, |
| 3453 | "4": { |
| 3454 | "name": "punctuation.definition.tag.end.js" |
| 3455 | } |
| 3456 | }, |
| 3457 | "patterns": [ |
| 3458 | { |
| 3459 | "include": "#jsx-tag" |
| 3460 | } |
| 3461 | ] |
| 3462 | }, |
| 3463 | "jsx-child-tag": { |
| 3464 | "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))", |
| 3465 | "end": "(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))", |
| 3466 | "endCaptures": { |
| 3467 | "0": { |
| 3468 | "name": "meta.tag.js" |
| 3469 | }, |
| 3470 | "1": { |
| 3471 | "name": "punctuation.definition.tag.end.js" |
| 3472 | }, |
| 3473 | "2": { |
| 3474 | "name": "punctuation.definition.tag.begin.js" |
| 3475 | }, |
| 3476 | "3": { |
| 3477 | "name": "entity.name.tag.js" |
| 3478 | }, |
| 3479 | "4": { |
| 3480 | "name": "punctuation.definition.tag.end.js" |
| 3481 | } |
| 3482 | }, |
| 3483 | "patterns": [ |
| 3484 | { |
| 3485 | "include": "#jsx-tag" |
| 3486 | } |
| 3487 | ] |
| 3488 | }, |
| 3489 | "jsx-tag": { |
| 3490 | "name": "meta.tag.js", |
| 3491 | "begin": "(?x)\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))", |
| 3492 | "end": "(?=(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)))", |
| 3493 | "patterns": [ |
| 3494 | { |
| 3495 | "begin": "(?x)\n (<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>)", |
| 3496 | "beginCaptures": { |
| 3497 | "1": { |
| 3498 | "name": "punctuation.definition.tag.begin.js" |
| 3499 | }, |
| 3500 | "2": { |
| 3501 | "name": "entity.name.tag.js" |
| 3502 | } |
| 3503 | }, |
| 3504 | "end": "(?=[/]?>)", |
| 3505 | "patterns": [ |
| 3506 | { |
| 3507 | "include": "#comment" |
| 3508 | }, |
| 3509 | { |
| 3510 | "include": "#jsx-tag-attributes" |
| 3511 | }, |
| 3512 | { |
| 3513 | "include": "#jsx-tag-attributes-illegal" |
| 3514 | } |
| 3515 | ] |
| 3516 | }, |
| 3517 | { |
| 3518 | "begin": "(>)", |
| 3519 | "beginCaptures": { |
| 3520 | "1": { |
| 3521 | "name": "punctuation.definition.tag.end.js" |
| 3522 | } |
| 3523 | }, |
| 3524 | "end": "(?=</)", |
| 3525 | "contentName": "meta.jsx.children.tsx", |
| 3526 | "patterns": [ |
| 3527 | { |
| 3528 | "include": "#jsx-children" |
| 3529 | } |
| 3530 | ] |
| 3531 | } |
| 3532 | ] |
| 3533 | }, |
| 3534 | "jsx-tag-invalid": { |
| 3535 | "name": "invalid.illegal.tag.incomplete.js", |
| 3536 | "match": "<\\s*>" |
| 3537 | }, |
| 3538 | "jsx-children": { |
| 3539 | "patterns": [ |
| 3540 | { |
| 3541 | "include": "#jsx-tag-without-attributes" |
| 3542 | }, |
| 3543 | { |
| 3544 | "include": "#jsx-child-tag" |
| 3545 | }, |
| 3546 | { |
| 3547 | "include": "#jsx-tag-invalid" |
| 3548 | }, |
| 3549 | { |
| 3550 | "include": "#jsx-evaluated-code" |
| 3551 | }, |
| 3552 | { |
| 3553 | "include": "#jsx-entities" |
| 3554 | } |
| 3555 | ] |
| 3556 | }, |
| 3557 | "jsx": { |
| 3558 | "patterns": [ |
| 3559 | { |
| 3560 | "include": "#jsx-tag-without-attributes" |
| 3561 | }, |
| 3562 | { |
| 3563 | "include": "#jsx-tag-in-expression" |
| 3564 | }, |
| 3565 | { |
| 3566 | "include": "#jsx-tag-invalid" |
| 3567 | } |
| 3568 | ] |
| 3569 | } |
| 3570 | }, |
| 3571 | "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/4d0bdebb93aadc25ecbb903ebc897e9cd5fab69c" |
| 3572 | } |