Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken attribute highlighting when using tag name interpolation #27

Open
nkovacs opened this issue Apr 27, 2017 · 1 comment
Open

Broken attribute highlighting when using tag name interpolation #27

nkovacs opened this issue Apr 27, 2017 · 1 comment

Comments

@nkovacs
Copy link

nkovacs commented Apr 27, 2017

- var tag='a'
// Broken
#{tag}(
    @click="doSomething", 
    :href="url",
)
// Broken
#{tag}(
    click="doSomething", 
    href="url",
)
// These work fine
a(
    @click="doSomething",
    :href="url",
)
a(
    click="doSomething",
    href="url",
)

screenshot from 2017-04-27 08-47-42

@nkovacs
Copy link
Author

nkovacs commented Apr 27, 2017

Ok, so the issue seems to be with the interpolation subpattern having the same name:

name: "source.script.jade entity.name.tag.pug"

It looks like this prevents the tag_name pattern from ending correctly, because if I log the cursor scope at ( (with the cursor in front of it), it still says "source.script.jade entity.name.tag.pug", whereas without the interpolation, it says "constant.name.attribute.tag.pug".

Renaming it to "source.script.jade entity.name.tag.pug.interpolated" fixes the highlighting for the attributes (the tag name ends correctly at } now), but the highlighting of the interpolation doesn't work correctly (it doesn't seem to work that well anywhere else either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant