|
493 | 493 |
|
494 | 494 | });
|
495 | 495 |
|
| 496 | + it("supports language-todo correctly", () => { |
| 497 | + |
| 498 | + let { tokens } = grammar.tokenizeLine( |
| 499 | +`\ |
| 500 | +<script> |
| 501 | +// NOTE: this 'NOTE' should be highlighted |
| 502 | +// NOTE: this 'NOTE' should be highlighted too </script> |
| 503 | +` |
| 504 | + ); |
| 505 | + |
| 506 | + expect(tokens[0]).toEqual({ |
| 507 | + value: "<", |
| 508 | + scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ] |
| 509 | + }); |
| 510 | + |
| 511 | + expect(tokens[1]).toEqual({ |
| 512 | + value: "script", |
| 513 | + scopes: [ "text.html.vue", "source.js.embedded.html", "entity.name.tag.script.html" ] |
| 514 | + }); |
| 515 | + |
| 516 | + expect(tokens[2]).toEqual({ |
| 517 | + value: ">", |
| 518 | + scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ] |
| 519 | + }); |
| 520 | + |
| 521 | + expect(tokens[3]).toEqual({ |
| 522 | + value: "\n", |
| 523 | + scopes: [ "text.html.vue", "source.js.embedded.html" ] |
| 524 | + }); |
| 525 | + |
| 526 | + expect(tokens[4]).toEqual({ |
| 527 | + value: "//", |
| 528 | + scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ] |
| 529 | + }); |
| 530 | + |
| 531 | + expect(tokens[5]).toEqual({ |
| 532 | + value: " NOTE: this 'NOTE' should be highlighted", |
| 533 | + scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ] |
| 534 | + }); |
| 535 | + |
| 536 | + expect(tokens[6]).toEqual({ |
| 537 | + value: "\n", |
| 538 | + scopes: [ "text.html.vue", "source.js.embedded.html" ] |
| 539 | + }); |
| 540 | + |
| 541 | + expect(tokens[7]).toEqual({ |
| 542 | + value: "//", |
| 543 | + scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ] |
| 544 | + }); |
| 545 | + |
| 546 | + expect(tokens[8]).toEqual({ |
| 547 | + value: " NOTE: this 'NOTE' should be highlighted too ", |
| 548 | + scopes: [ "text.html.vue", "source.js.embedded.html", "comment.line.double-slash.js" ] |
| 549 | + }); |
| 550 | + |
| 551 | + expect(tokens[9]).toEqual({ |
| 552 | + value: "</", |
| 553 | + scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ] |
| 554 | + }); |
| 555 | + |
| 556 | + expect(tokens[10]).toEqual({ |
| 557 | + value: "script", |
| 558 | + scopes: [ "text.html.vue", "source.js.embedded.html", "entity.name.tag.script.html" ] |
| 559 | + }); |
| 560 | + |
| 561 | + expect(tokens[11]).toEqual({ |
| 562 | + value: ">", |
| 563 | + scopes: [ "text.html.vue", "source.js.embedded.html", "punctuation.definition.tag.html" ] |
| 564 | + }); |
| 565 | + |
| 566 | + }); |
| 567 | + |
496 | 568 | });
|
497 | 569 | });
|
0 commit comments