vetur icon indicating copy to clipboard operation
vetur copied to clipboard

Tokenize vue specific attributes under `meta.directive.vue` when having no attribute value

Open usernamehw opened this issue 5 years ago • 5 comments

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Win 10
  • Vetur version: 0.14.3
  • VS Code version: 1.29.1

Problem

Having different color for vue-specific attributes:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": "meta.directive.vue entity.other.attribute-name.html",
            "settings": {
                "foreground": "#e90"
            }
        }
    ],
}

Some of them are not colorized because of the missing = after the attribute.

<template>
    <div>
        <div @click.prevent></div>
        <div @click.stop></div>
        <div v-on:click.stop></div>
        <div v-on:click.prevent></div>

        <form v-on:submit.prevent></form>
        <!-- ... -->
    </div>
</template>

It would be nice if colorization made = optional and worked for every case.

usernamehw avatar Dec 02 '18 12:12 usernamehw

@octref, you've missed an issue.

usernamehw avatar Dec 13 '18 23:12 usernamehw

Oops, I was traveling while you opened the issue. Somehow it slipped my inbox. Thanks for the reminder.

Similar to #883.

octref avatar Dec 14 '18 17:12 octref

That issue is asking for a way to colorize vue-specific attributes. It is already possible at least for half a year.

usernamehw avatar Dec 14 '18 17:12 usernamehw

Sorry, I had been busy and traveling. Let me get back to this...

octref avatar Feb 09 '19 17:02 octref

I also would like to see this improvement and be able to target each of the pieces separately.

        <div @click.prevent></div>
        <div @click.stop></div>
        <div v-on:click.stop></div>
        <div v-on:click.prevent></div>

        <form v-on:submit.prevent></form>

For example, each of these would be targeted by different scopes. Something like this.

  1. @, : scoped as some sort of symbol, operator, or ...
  2. v-on scoped as attribute.directive
  3. click scoped as attribute.name
  4. stop scoped as attribute.other

roydukkey avatar Dec 09 '21 17:12 roydukkey