PackageDev icon indicating copy to clipboard operation
PackageDev copied to clipboard

Auto generated syntax tests shouldn't fill the gaps

Open deathaxe opened this issue 1 year ago • 0 comments

The command packagedev_generate_syntax_tests_for_line creates a single assertion for meta.tag in following example, while it should create two separate ones for opening and closing tags.

    <p>Our website is in maintenance mode. Please, come back later.</p>
{#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.template.twig #}
{#  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.block.any.html #}
{#  ^ punctuation.definition.tag.begin.html #}
{#   ^ entity.name.tag.block.any.html #}
{#    ^ punctuation.definition.tag.end.html #}
{#                                                                 ^^ punctuation.definition.tag.begin.html #}
{#                                                                   ^ entity.name.tag.block.any.html #}
{#                                                                    ^ punctuation.definition.tag.end.html #}

That always happens if tokens of same scope appear on a line. Created tests expect the whole region between start of first and end of last token to be scoped. Gaps are ignored.

deathaxe avatar Oct 20 '24 12:10 deathaxe