vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.56k stars 373 forks source link

fix: directive syntax highlighting #4482

Closed KermanX closed 1 week ago

KermanX commented 1 week ago

fix #2550.

Before After
image image

About the regex

(?:(?:(v-[\w-]+)(:)?)|([:\.])|(@)|(#))(?:(?:(\[)([^\]]*)(\]))|([\w-]+))?
                  |                         \
(?:(?:(v-[\w-]+)(:)?)|([:\.])|(@)|(#))   (?:(?:(\[)([^\]]*)(\]))|([\w-]+))?
   v-a                                      <omit>                      Then, modifiers or expression
   v-a:                                     [expr]
   #                                        attr-name
   :
   .
   @
johnsoncodehk commented 1 week ago

This is awesome, thanks!