marko-js / language-server

Marko autocomplete, intellisense and editor support.
MIT License
38 stars 8 forks source link

Tag parameter type annotation breaks syntax highlighting #131

Closed rturnq closed 1 year ago

rturnq commented 1 year ago

marko-vscode@0.17.34

Details

Adding type annotation, specifically a :, to a tag parameter causes syntax highlighting to be incorrect from that point.

Expected Behavior

Syntax highlighting should not be affected outside of the type annotation.

Actual Behavior

Syntax highlighting is broken.

Steps to Reproduce

  1. Add component with tag parameters (eg for) along with some additional markup

    <div class="before">Before</div>
    <for|item| of=['']>
    <div class="within">Within</div>
    </for>
    <div class="after">After</div>
  2. Add type annotation to attribute

    <div class="before">Before</div>
    <for|item: string| of=['']>
    <div class="within">Within</div>
    </for>
    <div class="after">After</div>
  3. Notice syntax highlighting is no longer correct following the type annotation.

Before: image

After: image